Question: Java Experiment Exercises: 1. Rewrite the above code to use hierarchy Inheritance. 2. Read the below code carefully, then answer next questions. class A {



Java
Experiment Exercises: 1. Rewrite the above code to use hierarchy Inheritance. 2. Read the below code carefully, then answer next questions. class A { private int a; A inta) 4 this.a -a; System.out.println("This is constructor of class A"); } class B { private int bi private double e B(int b, double c) { this.b-b; this.c-c; System.out.println("This is constructor of class B"); class hh public static void main(String args[]) B bi - new B(10,8.6); 1. Find the result for the previous code : 2. Change class B to be class B extends A, then fin the result? 3. Change this.b=b to be super (b);", then find the result? 4. Change "this.c=c" to be "super(c);", then find the result? 5. Modify print statement to print the sending values? 6. What is the meaning of Super and this statements
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
