fork(2) download
  1. class A {
  2. 12. public void process() { System.out.print("A,"); }
  3. 13. class B extends A {
  4. 14. public void process() throws IOException {
  5. 15. super.process();
  6. 16. System.out.print("B,");
  7. 17. throw new IOException();
  8. 18. }
  9. 19. public static void main(String[] args) {
  10. 20. try { new B().process(); }
  11. 21. catch (IOException e) { System.out.println("Exception");}
  12. }
  13. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:2: illegal start of type
12. public void process() { System.out.print("A,"); }
^
Main.java:2: ';' expected
12. public void process() { System.out.print("A,"); }
   ^
Main.java:3: illegal start of type
13. class B extends A {
^
Main.java:3: ';' expected
13. class B extends A {
   ^
Main.java:3: <identifier> expected
13. class B extends A {
           ^
Main.java:3: <identifier> expected
13. class B extends A {
                     ^
Main.java:4: illegal start of type
14. public void process() throws IOException {
^
Main.java:4: <identifier> expected
14. public void process() throws IOException {
   ^
Main.java:4: ';' expected
14. public void process() throws IOException {
          ^
Main.java:4: invalid method declaration; return type required
14. public void process() throws IOException {
                ^
Main.java:5: not a statement
15. super.process();
^
Main.java:5: ';' expected
15. super.process();
   ^
Main.java:6: not a statement
16. System.out.print("B,");
^
Main.java:6: ';' expected
16. System.out.print("B,");
   ^
Main.java:7: not a statement
17. throw new IOException();
^
Main.java:7: ';' expected
17. throw new IOException();
   ^
Main.java:8: not a statement
18. }
^
Main.java:8: ';' expected
18. }
   ^
Main.java:9: illegal start of type
19. public static void main(String[] args) {
^
Main.java:9: ';' expected
19. public static void main(String[] args) {
   ^
Main.java:10: not a statement
20. try { new B().process(); }
^
Main.java:10: ';' expected
20. try { new B().process(); }
   ^
Main.java:10: 'try' without 'catch' or 'finally'
20. try { new B().process(); }
    ^
Main.java:11: not a statement
21. catch (IOException e) { System.out.println("Exception");}
^
Main.java:11: ';' expected
21. catch (IOException e) { System.out.println("Exception");}
   ^
Main.java:11: 'catch' without 'try'
21. catch (IOException e) { System.out.println("Exception");}
    ^
Main.java:11: ')' expected
21. catch (IOException e) { System.out.println("Exception");}
                      ^
Main.java:11: not a statement
21. catch (IOException e) { System.out.println("Exception");}
          ^
Main.java:11: ';' expected
21. catch (IOException e) { System.out.println("Exception");}
                        ^
29 errors
stdout
Standard output is empty