package com.javarush.task.task09.task0916;

import java.io.IOException;
import java.rmi.RemoteException;

/* 
Перехват checked-исключений
*/

public class Solution {
    public static void main(String[] args) {
        processExceptions(new Solution());
    }

    public static void processExceptions(Solution obj) {
        try {
            obj.method1();
            obj.method2();
            obj.method3();
        }
        catch (NoSuchFieldException e) {
            System.out.println(e.getClass().getSimpleName());
        }
        catch (RemoteException e) {
            System.out.println(e.getClass().getSimpleName());
        }
        catch (IOException e) {
            System.out.println(e.getClass().getSimpleName());
        }
    }

    public void method1() throws IOException {
        throw new IOException();
    }

    public void method2() throws NoSuchFieldException {
        throw new NoSuchFieldException();
    }

    public void method3() throws RemoteException {
        throw new RemoteException();
    }
}

Complete task0916