| preferred AP College board partner for AP classes
AP Computer Science A/Unit 5: Writing Classes
Start Practice TestPractice Test
About Exam
medium Solved by 18 students
Logical Operator Precedence
< Prev
Next >

What is printed to the console when the following code is executed?

public class LogicTest {
    public static void main(String[] args) {
        boolean a = true;
        boolean b = false;
        System.out.println(a || b && a);
    }
}
A

true

B

Runtime Error

C

Compilation Error

D

false

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
#1sailajavadlamani3322 0m 00s 200
#2Ishaan.m.kurup11 0m 00s 100
#3sgarv251311 0m 00s 100
#4dinhhoa11 0m 00s 100
#5songqiuhui201211 0m 16s 84
#6psak1211 0m 32s 68
#7chunxiangxu.cxu11 0m 38s 62
#8suhanakochhar00611 0m 58s 42
#9varunrajaram111 1m 35s 5
#10y.seong202711 1m 49s -9
Items per page:
10
1 – 10 of 11
No comments yet. Be the first to comment!

AI Tutor

How can I help?

APFIVE © 2020.
Email: apfive@apfive.org|Privacy Policy