aquaballoon

Java - Anonymous Inner Class (ActionListener, Runnable)

Jul 15th, 2013
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.43 KB | None | 0 0
  1. http://blog.naver.com/euro87?Redirect=Log&logNo=120184592615
  2. // Anonymous Inner Class => No need for the object of class
  3. // Need for ActionListener, Runnable interface
  4.  
  5. public class A{
  6.     int x;
  7.     public void test(){
  8.         //...
  9.     }  
  10. }  
  11.  
  12. A a = new A(){                     // No need for the object of class
  13.            public void test(){
  14.                // ...              // ----> Overriding
  15.            }
  16.        };
Advertisement
Add Comment
Please, Sign In to add comment