Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as Java by fuze ( 15 years ago )
class Fir{
 void show(){
  
 }
}

class Sec extends Fir{
 void show(){
  System.out.println("Sec");
 }
 
}

class R extends Fir{
 void show(){
  System.out.println("R");
  show2();
 }

 void show2(){
  System.out.println("show2");
 }
}

class T{
 public static void main(String arg[]){
  Sec s =new Sec();
  R r   =new R();
  Fir d[]=new Fir[10];
  d[0]     =s;
  d[1]     =r;
  d[2]     =r;
  d[3]     =s;
  for(int k=0;k<4;k++)d[k].show();
  
 }
}

 

Revise this Paste

Your Name: Code Language: