Last active
November 23, 2016 16:41
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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