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

Given:

What is the result?

    Correct Answer: D

    The given code uses a nested ternary operation to determine what value to print. Let's break it down: int i = 3; int j = 25; System.out.println( i > 2 ? i > 10 ? i * (j + 10) : i * j + 5 : i ); First, the outer ternary operator checks if 'i' is greater than 2, which is true since i = 3. Since this condition is true, we move to the second part of the ternary operation: i > 10 ? i * (j + 10) : i * j + 5. Now, we check if 'i' is greater than 10, which is false. Since this condition is false, we take the else part of the second ternary expression: i * j + 5. Here, i * j + 5 = 3 * 25 + 5 = 75 + 5 = 80. Therefore, the result is 80.

Discussion
d7bb0b2Option: D

D 80 is correct

d7bb0b2

the expresion looks like this: if (i > 2) { if (i > 10) { System.out.println(i * (j + 10)); } else { System.out.println(i * j + 5); } } else { System.out.println(i); }

[Removed]Option: D

D is correct

StavokOption: D

Correct answer is D TESTED

JticOption: D

tested: 80

ObaltOption: D

Correct answer is D