fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Ideone {
  6. public static void main (String[] args) throws java.lang.Exception {
  7. StealSecret ss = new StealSecret();
  8. }
  9. }
  10. class Locker {
  11. private String secret = "This is my secret";
  12. Util getUtil() { return new Util(); }
  13. protected class Util { String getSecret() { return secret; } }
  14. }
  15.  
  16. class StealSecret extends Locker {
  17. private String secret = "shadowed";
  18. public StealSecret() {
  19. StealSecret.Util u = new StealSecret.Util();
  20. System.out.println(u.getSecret());
  21. }
  22. }
Success #stdin #stdout 0.1s 320512KB
stdin
Standard input is empty
stdout
This is my secret