Java Reference
In-Depth Information
24. Given the following interface definitions:
1. //Readable.java
2. public interface Readable {
3. public abstract void read();
4. }
1. //SpellCheck.java
2. public interface SpellCheck extends Readable {
3. public void checkSpelling();
4. }
which of the following statements are true? (Select all that apply.)
A. The SpellCheck interface does not compile.
B. A class that implements Readable must override the read method.
C. A class that implements SpellCheck inherits both the checkSpelling and read
methods.
D. A class that implements SpellCheck only inherits the checkSpelling method.
E. An interface cannot extend another interface.
25. Given the following class definitions:
1. class Pet {
2. {
3. System.out.print(“A”);
4. }
5. public Pet() {
6. System.out.print(“B”);
7. }
8. {
9. System.out.print(“C”);
10. }
11.
12.}
13.
14. class Cat extends Pet {
15. public Cat() {
16. System.out.print(“D”);
17. }
18. static {
19. System.out.print(“E”);
20. }
21.}
Search WWH ::




Custom Search