Oracle
1Z0-803 · Question #166
1Z0-803 Question #166: Real Exam Question with Answer & Explanation
The correct answer is C: 26 is not divisible by 5. See the full explanation below for the reasoning.
Question
Given: public class Test { public static void main (String[] args) { int i = 25; int j = i++ + 1; if (j % 5 == 0) { System.out.println(j + " is divisible by 5"); } else { System.out.println(j + " is not divisible by 5"); } System.out.println("Done"); } } What is the result?
Options
- ACompilation fails.
- B25 is divisible by 5
- C26 is not divisible by 5
- D27 is not divisible by 5
Community Discussion
No community discussion yet for this question.