Which lines of output are displayed by the following program?
class Question {
public static void main(String[] args) {
Class2 v2 = new Class2();
v2.display();
}
}
class Class1 {
String s = "Class1";
void display() {
System.out.println(s);
}
}
class Class2 extends Class1 {
String s = "Class2";
}
Please select all the correct answers.
|