Skip to content

Instantly share code, notes, and snippets.

@tshevchuk
Last active November 23, 2016 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tshevchuk/a40ca538b12ea40eadfbb1f69a34d8ef to your computer and use it in GitHub Desktop.
Save tshevchuk/a40ca538b12ea40eadfbb1f69a34d8ef to your computer and use it in GitHub Desktop.
C:\projects\LearnProgramming\java_certif\mock exams\examlab\src\com\tshevchuk\MYE.java Error:(15, 15) java: exception com.tshevchuk.Exception1 is never thrown in body of corresponding try statement
package com.tshevchuk;
class Exception1 extends Exception {
}
class Exception2 extends Exception {
}
public class MYE {
public static void main(String[] args) {
try {
try {
throw new Exception2();
} catch (Exception1 e1) {
System.out.print("Ex1 ");
} catch (Exception2 e2) {
System.out.print("Ex2 ");
} finally {
System.out.print("Fi-1 ");
}
}catch (Exception ex){
}finally {
System.out.print("Fi-2");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment