Manish Pamnani wrote:. . . SO, it's like pouring water from a small glass to a larger one?
The cast is more like pouring water from one glass back into the same glass because the variable is an
int before and after. The
= assignment is like pouring the water into a larger glass, because it automatically changes the expression from an
int to a
long. The
javac tool won't let you even try pouring a
long into an
int, because you are pouring the water from a large glass into a small glass and most of it will go onto the floor.