waltermilner

Untitled

May 31st, 2014
377
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1. public class Test {
  2.  
  3.     public static void main(String[] args) {
  4.         Outer.Static.method();
  5.         Outer instance = new Outer();
  6.         instance.field.method();
  7.  
  8.     }
  9.  
  10. }
  11.  
  12. class Outer {
  13.  
  14.     static class Static {
  15.  
  16.         static void method() {
  17.             System.out.println("In static class");
  18.         }
  19.     }
  20.  
  21.     NonStatic field = new NonStatic();
  22.  
  23.     class NonStatic {
  24.  
  25.         void method() {
  26.             System.out.println("In non-static class");
  27.         }
  28.     }
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment