Are you taking CLEP classes? Try clep.ai
| preferred AP College board partner for AP classes
AP Computer Science A/Unit 1: Primitive Types
Start Practice TestPractice Test
About Exam
hard Solved by 1 students

Static Method Call Resolution

Mark
< Prev
Next >

What is printed as a result of executing the following code segment?

class SuperClass {
    static void display() { System.out.print("Super"); }
}
class SubClass extends SuperClass {
    static void display() { System.out.print("Sub"); }
}
public class Test {
    public static void main(String[] args) {
        SuperClass obj = new SubClass();
        obj.display();
    }
}
A

Sub

B

Super

C

SuperSub

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
#1braydenchoi111101 0m 00s -10
#2anthonygraves15701 0m 41s -51
#3lsj0803092212 3m 25s -115
Items per page:
10
1 – 3 of 3

AI Tutor

How can I help?

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