Given:
2. interface Printable { } 3. interface Writable { } 4. abstract interface Shape extends Printable, Writable { 5. void pullShape(); 6. } //from w w w. java 2s . c om 7. class Rectangle implements Shape { 8. public void pullShape() { System.out.print("pulling "); } 9. } 10. class Square implements Shape extends Rectangle { 11. public void pullShape() { System.out.print("pulling harder "); } 12. } 13. public class Box extends Rectangle implements Shape, Writable { }
What is the result? (Choose all that apply.)
D is correct.
When a class implements and extends, the extends declaration comes first.
A, B, C, and E are incorrect because all of the other code is legal.
It is legal to "re-extend" an interface, and it's legal to implement several interfaces.