Lowest price ever! Learn Generative AI for 48% less!
Get my discount0
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