int number1 = 13;
int number2 = 4;
System.out.println(number1/number2); //Division between int types
//console
3
Calculation between int types "13/4" becomes 3 What if I want to get an accurate value by dividing int type variables ??
int number1 = 13;
int number2 = 4;
System.out.println((double)number1/number2);
//console
3.25 //Double type calculation result
In such a case, forcibly perform type conversion This is called a cast and is the value (the data type you want to convert).
When you want to finally obtain the double type calculation result from the values โโof int types Cast either one (Java will decide the other)