fork 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. private class Ideone
  9. {
  10. protected Ideone()
  11. {
  12. System.out.println("Parent Hello");
  13. }
  14. }
  15.  
  16. class B extends Ideone
  17. {
  18. public B()
  19. {
  20. System.out.println("Hello");
  21. }
  22. }
  23. public class Main
  24. {
  25. public static void main( String args[])
  26. {
  27. Ideone I = new Ideone();
  28. B one = new B();
  29. }
  30. }
Compilation error #stdin compilation error #stdout 0.1s 321600KB
stdin
Standard input is empty
compilation info
Main.java:8: error: modifier private not allowed here
private class Ideone
        ^
1 error
stdout
Standard output is empty