fork(1) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. private static class Bar {}
  11.  
  12. public static void main (String[] args) throws java.lang.Exception
  13. {
  14. class Foo$o {
  15. class Bar$bar {}
  16. };
  17. class Foo$o$Bar {
  18. class Bar$bar {}
  19. };
  20. print(Ideone.class);
  21. print(Bar.class);
  22. print(Foo$o.class);
  23. print(Foo$o.Bar$bar.class);
  24. print(Foo$o$Bar.Bar$bar.class);
  25. }
  26.  
  27. private static void print(Class<?> clazz) {
  28. System.out.printf("fqn=%s, sn=%s%n", clazz.getName(), clazz.getSimpleName());
  29. }
  30. }
Success #stdin #stdout 0.1s 320576KB
stdin
Standard input is empty
stdout
fqn=Ideone, sn=Ideone
fqn=Ideone$Bar, sn=Bar
fqn=Ideone$1Foo$o, sn=Foo$o
fqn=Ideone$1Foo$o$Bar$bar, sn=Bar$bar
fqn=Ideone$1Foo$o$Bar$Bar$bar, sn=Bar$bar