Exam 1z0-819 All QuestionsBrowse all questions from this exam
Question 192

Given:

What is the result?

    Correct Answer: B

    The binary literal 0B1010_1010_0101_1001_0110 is used. In Java, binary literals that fit within a 32-bit integer are treated as integers by default. However, the given binary number exceeds the 32-bit integer range (it exceeds 2^31 - 1), so it is treated as a long by default. Therefore, the method with the long parameter is called, which prints "two".

Discussion
ASPushkin

same as 199

d7bb0b2Option: C

0B1010_1010_0101_1001_0110 is an int in binary 0B1010_1010_0101_1001_0110L is a long binary

d7bb0b2Option: C

0B1010_1010_0101_1001_0110 => is a 11111110 So fit int then int method is called

ASPushkin

if it not fit it will be compile error : "integer number too large" by default all numbers in java have an int type