classes), the method executed by s.draw() depends on the actual type of the object that s refers
to, not on the type of the variable s.
Overridden variable depends on the type of variable of s
Shape s = new Circle();
System.out.println(s.getClass()); // class Circle
s.draw();
int t = s.i;
int k= s.j;//??
s.erase(); //???
s.setColor();
Shape
i: int
draw()
setColor()
Circle
i: int
j:int
draw()
erase()
Triangle
i: int
draw()
erase()
Line
i: int
draw()
erase()
