Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- public static void main (String[] args){
- myMethod();
- try{
- myMethod();
- mySecondMethod();
- }catch(Exception e){
- System.out.println("Eccezione");
- }
- finally {
- System.out.println("Sono ancora vivo");
- }
- }
- public static void myMethod(){
- throw new MyException("Una eccezione checked");
- }
- public static void mySecondMethod() throws Exception{
- throw new Exception("Una eccezione unchecked");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement