Question 101
Given:

What is the result?

What is the result?
Question 102
Given:

And given the code fragment:

What is the result?

And given the code fragment:

What is the result?
Question 103
Given the code fragment:

What is the result?

What is the result?
Question 104
Given:

And given the code fragment:

What is the result?
4W 100 Auto

And given the code fragment:

What is the result?
4W 100 Auto
Question 105
Given:
Given:
public class SuperTest {
public static void main(String[] args) {
statement1
statement2
statement3
}
}
class Shape {
public Shape() {
System.out.println("Shape: constructor");
}
public void foo() {
System.out.println("Shape: foo");
}
}
class Square extends Shape {
public Square() {
super();
}
public Square(String label) {
System.out.println("Square: constructor");
}
public void foo() {
super.foo();
}
public void foo(String label) {
System.out.println("Square: foo");
}
}
}
}
What should statement1, statement2, and statement3, be respectively, in order to produce the result?
Shape: constructor Square: foo Shape: foo
Given:
public class SuperTest {
public static void main(String[] args) {
statement1
statement2
statement3
}
}
class Shape {
public Shape() {
System.out.println("Shape: constructor");
}
public void foo() {
System.out.println("Shape: foo");
}
}
class Square extends Shape {
public Square() {
super();
}
public Square(String label) {
System.out.println("Square: constructor");
}
public void foo() {
super.foo();
}
public void foo(String label) {
System.out.println("Square: foo");
}
}
}
}
What should statement1, statement2, and statement3, be respectively, in order to produce the result?
Shape: constructor Square: foo Shape: foo