| 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 2 students
Static Method Call Resolution
< 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

Runtime Error

C

Super

D

SuperSub

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
#1braydenchoi111101 0m 00s -10
#2anthonygraves15701 0m 41s -51
#3lsj0803092212 3m 25s -115
Items per page:
10
1 – 3 of 3
No comments yet. Be the first to comment!

AI Tutor

How can I help?

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