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

Given:

What is the result?

    Correct Answer: B

    The given code will fail to compile. The literal '0B1010_0101_1001_0110' is a binary literal. In Java, binary literals must start with '0b' or '0B' followed by a sequence of binary digits (0s and 1s), and underscores are allowed between the digits to make the number easier to read. The compilation error in this case is due to the use of an underscore within the binary literal. According to Java syntax rules, underscores cannot be placed at the beginning, the end, or adjacent to the binary prefix ('0b' or '0B'). Therefore, the presence of these underscores in the middle of the binary number makes the code invalid, causing a compilation error.

Discussion
d7bb0b2Option: C

oB1010_0101_1001_0110 is a BINARY int oB1010_0101_1001_0110L is a Binary long if L is not present then is a int so call to int method

ASPushkinOption: C

answer : C Method invocation convertion : primitive widening>boxing>varargs oB1010_0101_1001_0110 - by default any nuber considered as an "int" so, this case is the exact match.