APFIVE APFIVE | preferred AP College board partner for AP classes
Login
 
Register
AP Classes
AP Human Geography AP Computer Science A AP Comparative Government and Politics AP European History AP Macroeconomics AP Microeconomics AP Psychology AP United States Government and Politics AP United States History AP Calculus AB AP Calculus BC AP Computer Science Principles AP Precalculus AP Statistics AP Biology AP Chemistry AP Environmental Science AP Chinese AP Art History AP English Literature AP Research AP Spanish Literature AP Art & Design AP World History: Modern AP English Language AP French AP German AP Japanese AP Latin AP Italian AP Spanish Language AP Music Theory AP Physics 1 AP Physics 2 AP Physics C: Mechanics AP Physics C: E&M AP African American Studies
AP Computer Science A/Unit 3: Boolean Expressions and if Statements
Start Practice Test
Share
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

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