Tuesday, 20 August 2013

Quick java clarification needed for student

Quick java clarification needed for student

I am reviewing a piece of code that looks like this:
float x = 9;
float y = 5;
int z = (int)(x / y);



Question:
I am wondering why there is a second int on line 3 when it is already
declared that z is an int. Thanks in advance.

No comments:

Post a Comment