in java,
Consider the code shown below. It contains a syntax error, preventing successful compilation and execution. What is the error?
public class Inherit
{
class Figure
void display()
System.out.println("Figure");
}
class Rectangle extends Figure
final void display()
System.out.println("Rectangle");
class Box extends Rectangle
void display() {
System.out.println("Box");
Inherit()
Figure f = new Figure();
Rectangle r = new Rectangle();
Box b = new Box();
f.display();
r.display();
b.display();
public static void main(String[] args)
new Inherit();
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here