-1
int s=0;
s+=Math.pow(2,3);

this line does not show possible lossy conversion whereas

int s=0
s=s+Math.pow(2,3)

the above line shows error. Any reason for this?

Turing85
  • 16,432
  • 7
  • 31
  • 51

1 Answers1

0

The problem is due to the method signature for Math.pow;. It returns the result as a double. You then attempte to return the double as an int, and that is a lossy conversion.