| preferred AP College board partner for AP classes
medium Solved by 24 students
Short-Circuit Evaluation with Logical OR
< Prev
Next >

What is printed when the following code segment is executed?

public class Main {
    public static void main(String[] args) {
         int a = 3, b = 5;
         if(a < b || a++ > 3)
             System.out.println(a);
         else
             System.out.println(b);
    }
}
A

5

B

Compilation Error

C

4

D

3

Hint
Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Time
Score
#1kazvin.tjakradinata33 0m 44s 256
#2dobaonam838622 0m 38s 162
#3lukeydragon2711 0m 00s 100
#4sgarv251311 0m 00s 100
#5chunxiangxu.cxu11 0m 15s 85
#627patelp11 0m 18s 82
#7namansoin00011 0m 28s 72
#8psak1211 0m 56s 44
#9thuyjerry01 0m 05s -15
#10y.seong202713 3m 21s -121
Items per page:
10
1 – 10 of 12
No comments yet. Be the first to comment!

AI Tutor

How can I help?

APFIVE © 2020.
Email: [email protected]|Privacy Policy