Choosing how to earn college credit? CLEP vs AP guide
| preferred AP College board partner for AP classes
AP Computer Science A/Unit 3: Class Creation
Start Practice TestPractice Test
About Exam
medium Solved by 15 students

Logical Operator Precedence

Mark
< 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

false

B

true

C

Compilation Error

D

Runtime Error

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

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Total Time
Score
#1sailajavadlamani3322 - 200
#2dinhhoa11 - 100
#3sgarv251311 - 100
#4Ishaan.m.kurup11 - 100
#5songqiuhui201211 0m 16s 84
#6busemagngr11 0m 20s 80
#7psak1211 0m 32s 68
#8chunxiangxu.cxu11 0m 38s 62
#9suhanakochhar00611 0m 58s 42
#10varunrajaram111 1m 35s 5
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: apfive@apfive.org|Instagram: @_apfive_|Privacy Policy|