Which method will be executed when the following statements are executed?
```
ClassC item1 = new ClassA();
item1.method1();
```
```
Given 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 }
```
a. Line 4
b. Line 9
c. Line 14
d. This is an error and will cause the program to crash.
d. This is an error and will cause the program to crash.
You might also like to view...
What is leading? What is its purpose? Explain “set solid” in terms of leading. Is set solid a good choice for body text on a Web page? Why or why not?
What will be an ideal response?
Two environmental conditions that can damage a computer are heat and ________
A) humidity B) barometric pressure C) air pressure D) wind
What type of inheritance does Java support?
A. single inheritance B. double inheritance C. multiple inheritance D. Java does not support inheritance.
Themes cannot be customized in Excel
Indicate whether the statement is true or false.