Here is a way that you can do it:
public class Decifrac{
public static void main(String[] args){
int a = 9;
int b = 8;
double c = ((a * 1.0)/b) ;
System.out.println("You could show it as a fraction like this: " + a + "/" + b);
System.out.println("And you can show it as a decimal like this: " + c); //c is a double (Decimal value)
}
}
Where it says (a * 1.0), this is needed so it converts the number into a double, if you don't you will just get 1.0. I also think you might be able to hard code the variables a and b to be like 9.0 or something like that, or even casting one of the variables like c = ((double)a)/b;.
I am sure there is another way, but this one should suit a beginner. If you have any question feel free to ask.