Question: Analyze the tollowing code: ` ` ` public class Test { public static void main ( String args ) { Bb = new B
Analyze the tollowing code:
public class Test
public static void mainString args
Bb new B;
bm;
System.out.printlni is bi;
class A
int i;
public void mint i
this. i ;
l
class B extends A
public void mString s
The program has a compilation error, because m is overridden with a different signature in B
The program has a compilation error, because bm cannot be invoked since the method mint is
hidden in B
The program has a runtime error on bi because i is not accessible from b
The method m is not overridden in b B inherits the method m from A and defines an overloaded
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
