Object Oriented Programming (OOPs)

© examsiri.com
Question : 2 of 72
 
Marks: +1, -0
Place the Output Options in the Actual Output Sequence to indicate the output from this code:
class Alpha {
  public void foo( String... args )
   {System.out.print ("Alpha : foo"); }
  public void bar( String a )
   {System.out.print ("Alpha : bar"); }
}
public class Beta extends Alpha {
  public void foo ( String a)
   {System.out.print ( "Beta : foo" ); }
  public void bar( String a)
   {System.out.print( "Beta : bar" ); }
  public static void main ( String[] argv) {
   Alpha a = new Beta();
   Beta b = (Beta)a;
   a.foo( "test" ); b.foo( "test" );
   a.bar( "test" ); b.bar( "test" );
  }
}

Actual Output Sequence
(i)__________ (ii)____________ (iii)___________ (iv)_____________
  • Blank(i) ______


  • Blank(ii) ______


  • Blank(iii) ______


  • Blank(iv) ______


Go to Question: