Advertisement
JeffGrigg

Extending Private Class

Sep 18th, 2017
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 0.44 KB | None | 0 0
  1. public class AnyOldClass {
  2.     private static class PrivateStaticClass {
  3.         protected void procedure() {
  4.             System.out.println("PrivateStaticClass.procedure() says 'Hi!'");
  5.         }
  6.     }
  7.     static class Subclass extends PrivateStaticClass {
  8.         public void someOtherMethod() {
  9.             super.procedure();
  10.         }
  11.     }
  12.     public static void main(String[] args) {
  13.         new Subclass().someOtherMethod();
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement