Question: Given the following two classes in Java : * And these lines of code ( written in main class ) : * What
Given the following two classes in Java :

* And these lines of code ( written in " main class " ) :

* What would be the result / output ? explain ( **note : running these lines of code could also result in a compilation / or run-time error ).
public class A ( public int ai private int bi public A{int a, int b) publie int getB return b public int E return f(0) i public int f(int c) return b+ci publie String tostring return aab public class B extends A I public int ai private int b public B(int a, int b)[ super (a, b)i a-a+1i bb+1i public int getB returnb public int t return auper.E 0 public int f int c return super.E(b+c) public String tostring return "a"a+ b"b
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
