Gaelle Berton wrote: . . . does Long(5L) == Long(5) == 5L ?
No. The first two are different Long objects which return
true from their
equals() methods, and the third is a primitive recorded as a two's complement 64-bit integer with 0000...0101 as its value where ... replaces 56 0s.
Please always
tell us where the question is from, so we know it is not a "cheating" source. There are "cheating" sources, which we prohibit use of.
Get a pencil and paper, and go through the execution, and see what the values are at each stage of the loop. Only that way will you understand how you are getting the output.
And welcome to the Ranch