Question 6
Answer saved
Flag
question
The following code will print "Derived" because the method in the subclass hides the method in the superclass.
class Base {
static void display() {
System.out.println("Base");
}
class Derived extends Base {
static void display() {
System.out.println("Derived");
}
public class Main (
public static void main(String[] args) {
Derived.display();
}
}
True
False