Static Method Call Resolution
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
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | braydenchoi1111 | 0 | 1 | 0m 00s | -10 |
| #2 | anthonygraves157 | 0 | 1 | 0m 41s | -51 |
| #3 | lsj08030922 | 1 | 2 | 3m 25s | -115 |
Items per page:
10
1 – 3 of 3
APFIVE