Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Test {
- public static void main(String[] args) {
- Outer.Static.method();
- Outer instance = new Outer();
- instance.field.method();
- }
- }
- class Outer {
- static class Static {
- static void method() {
- System.out.println("In static class");
- }
- }
- NonStatic field = new NonStatic();
- class NonStatic {
- void method() {
- System.out.println("In non-static class");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment