New course! Every coder should learn Generative AI!
Try a free lesson0
During mathematical calculations the Java compiler automatically modifies the data types of some variables so as to maintain homogeneity throughout the mathematical expression.
Eg:
int x=5
double y=12,5
double ans=x*y
To solve this, the compiler first changes the datatype of x into double and then calculates the value in douublw