Respuesta :

All methods are obtained from Rectangle (except constructors). Thus, ColorRectangle object variables can be used with getHeight(). These techniques are borrowed from Rectangle in Java.

Consequently, Rectangle's public methods plus any additional public methods defined in ColorRectangle make up the public methods of ColorRectangle. The reason is that if you modify the methods, everyone who uses your class will need to rewrite their code. releasing updated versions that make minor changes).

public class Test {

  public static void main(String args[]) {

     A a = new A(3);

  }

}

class A extends B {

  public A(int n) {

     System.out.println("A’s constructor is invoked.");

  }

}

class B {

  public B() {

     System.out.println("B’s constructor is invoked.");

  }

}

Learn more about variables here-

https://brainly.com/question/13375207

#SPJ4

RELAXING NOICE
Relax