Question 14
Consider the code given below.
class Shape { public void draw() { System.out.println("Drawing a shape"); }}class Rectangle extends Shape { public void draw() { System.out.println("Drawing a rectangle"); }}class Square extends Rectangle { public void draw() { System.out.println("Drawing a square"); } public void color() { System.out.println("Square is colorful"); }}public class TestShapes { public static void main(String[] args) { Shape s = new Rectangle(); Rectangle r = new Square(); // LINE 1 s.draw(); r.color(); // LINE 2 }}Choose the correct option.