Question 27 / 90:  Given the following code segment, what will print?
System.out.println("A" + 1 + (1 + 1) + 1);
                                
A  A1111
B  A121
C  A13
D  A31
E  Compilation error
<< First < Previous Next > Last >>
Explanation:

B. Precedence occurs first with the enclosed 1+1 equation.

The evaluation then continues at the beginning of the expression with the string, and each value after the string is appended as string, resulting in A121.

A, C, and D are incorrect because the resultant output is A121.

E is incorrect because there is no compilation error.

Exam Home Page
https://www.jobilize.com/quiz-my-oca-mock-exam-by-mike-wolf

My OCA Mock

Author:

Access: Public Instant Grading

Ask
George Turner
Start Quiz
Rylee Minllic
Start Quiz
Copy and paste the following HTML code into your website or blog.
<iframe src="https://www.jobilize.com/embed/quiz-my-oca-mock-exam-by-mike-wolf" width="600" height="600" frameborder="0" marginwidth="0" marginheight="0" scrolling="yes" style="border:1px solid #CCC; border-width:1px 1px 0; margin-bottom:5px" allowfullscreen webkitallowfullscreen mozallowfullscreen> </iframe>