Java, JavaScript, Javascript Tips, Javascript Development, Java8.
void main(String[] args) { Shape s1 = new Circle(“Red”, 2.2); Shape s2 = new Rectangle(“Yellow”, 2, 4); System.out.println(s1.toString()); System.out.println(s2.toString()); } } Output Shape constructor called Circle constructor called Shape constructor called Rectangle constructor called Circle