Multiple Choice
Look at the following code. Line 1 public class ClassA
Line 2 {
Line 3 public ClassA() {}
Line 4 public void method1(int a) {}
Line 5 }
Line 6 public class ClassB extends ClassA
Line 7 {
Line 8 public ClassB() {}
Line 9 public void method1() {}
Line 10 }
Line 11 public class ClassC extends ClassB
Line 12 {
Line 13 public ClassC() {}
Line 14 public void method1() {}
Line 15 }
Which method will be executed as a result of the following statements?
ClassB item1 = new ClassA() ;
Item1.method1() ;
A) Line 4
B) Line 9
C) Line 14
D) This is an error and will cause the program to crash.
Correct Answer:

Verified
Correct Answer:
Verified
Q46: Protected members are:<br>A) not quite private<br>B) not
Q47: This is a special type of expression
Q48: Which of the following statements correctly specifies
Q49: Which of the following is an example
Q50: An anonymous inner class must:<br>A) implement an
Q52: Look at the following code. Which line
Q53: When an "is a" relationship exists between
Q54: In the following statement, which is the
Q55: Which of the following statements declares Salaried
Q56: If a class contains an abstract method:<br>A)