What is the output of the following code?
1: class Shape { 2: public Shape(int edge) { 3: System.out.print("Shape"); 4: } 5: } 6: public class Rectangle extends Shape { 7: public Rectangle() { 8: System.out.print("Rectangle"); 9: } 10: public static void main(String[] args) { 11: new Shape(5); 12: } 13: }
E.
The code will not compile because the parent class Shape doesn't define a no-argument constructor, so the first line of a Rectangle constructor should be an explicit call to super(int edge).