Choose the correct statement about the following code:
1: interface Printable { 2: abstract int getNumberOfSections(); 3: } 4: abstract class Shape implements Printable { 5: abstract int getWidth(); 6: } 7: public class Rectangle extends Shape { 8: int getWidth() { return 6; } 9: }
D.
The code fails to compile because Rectangle, the first concrete subclass, doesn't implement getNumberOfSections(), which is inherited as an abstract method; therefore, option D is correct.
B is incorrect since this interface method definition is correct.
C is incorrect since an abstract class is not required to implement any abstract methods, including those inherited from an interface.
E is incorrect because the code fails at compilation-time.