Java Inheritance: Square, Shapes, Objects!

Report a typo

Consider the following class hierarchy in Java:

class Shape { public void draw() { } }
class Circle extends Shape { }
class Square extends Shape { }
You have just referenced a Square object through the following Java code:
Shape shape = new Square();
Which of the following statements about the relationship of the referenced object to the base 'Object' class in Java are true?
Select one or more options from the list
___

Create a free account to access the full topic