Anonymous Inner Class in Java


Source Code

//Anonymous Inner Class
 
abstract class testDemo {
    abstract void display();
}
 
class outerDemo {
    public void outerDisplay() {
        testDemo o =new testDemo() {
            @Override
            public void display() {
                System.out.println("Test Display");
            }
        };
        o.display();
    }
}
 
 
public class anonymousInner {
    public static void main(String[] args) {
        outerDemo o =new outerDemo();
        o.outerDisplay();
    }
}
 
To download raw file Click Here

Basic Programs



Learn All in Tamil © Designed & Developed By Tutor Joes