The program compiles fine, but you cannot create an instance of Square because t
ID: 3909168 • Letter: T
Question
The program compiles fine, but you cannot create an instance of Square because the constructor does not specify the length of the Square.
The program has a compile error because you attempted to invoke the GeometricObject class's constructor illegally.
The program compiles fine, but it has a runtime error because of invoking the Square class's constructor illegally.
The program compiles fine, but you cannot create an instance of Square because the constructor does not specify the length of the Square.
The program has a compile error because you attempted to invoke the GeometricObject class's constructor illegally.
The program compiles fine, but it has a runtime error because of invoking the Square class's constructor illegally.
Explanation / Answer
Answer:
The program has a compile error because you attempted to invoke the GeometricObject class's constructor illegally.
class Square extends GeometricObject {
double length;
Square(double length) {
GeometricObject(length);
}
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.