Anonymous inner class are mainly created in two ways:
Class (may be abstract or concrete)
Interface
CODING:Class (may be abstract or concrete)
Interface
interface demo{
void disp();
}
public class anonnymous {
public static void main(String[] args){
demo o=new demo(){
public void disp(){
System.out.println("Anonymous Show");
}
};
o.disp();
}
}
void disp();
}
public class anonnymous {
public static void main(String[] args){
demo o=new demo(){
public void disp(){
System.out.println("Anonymous Show");
}
};
o.disp();
}
}
Comments
Post a Comment