fork(3) download
  1. public class TextEx{
  2. static class Ex1 extends Exception{}
  3. static class Ex2 extends Ex1{}
  4. static class Ex3 extends Exception{}
  5. static void method1() throws Ex1,Ex2,Ex3{
  6. throw new Ex2();
  7. }
  8. public static void main(String args[]){
  9. try
  10. {
  11. method1();
  12. }
  13. catch(Ex3 e) {
  14. System.out.print('C');
  15. }catch(Ex2 e) {
  16. System.out.print('B');
  17. }catch(Ex1 e) {
  18. System.out.print('A');
  19. }catch(Exception e) {
  20. System.out.print('D');
  21. }
  22. finally{
  23. System.out.print('F');
  24. }
  25. }
  26. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: class TextEx is public, should be declared in a file named TextEx.java
public class TextEx{
       ^
1 error
stdout
Standard output is empty