Почему необходимо «выбрасывать исключение» при вызове функции?

class throwseg1
{
    void show() throws Exception
    {
        throw new Exception("my.own.Exception");
    }

    void show2() throws Exception  // Why throws is necessary here ?
    {
        show();
    }

    void show3() throws Exception  // Why throws is necessary here ?
    {
        show2();
    }

    public static void main(String s[]) throws Exception  // Why throws is necessary here ?
    {
        throwseg1 o1 = new throwseg1();
        o1.show3();
    }
}

Почему компилятор сообщает, что методы show2(), show3()и main()имеют

unreported exception Exception that must be caught or declared to be thrown

когда я удаляю throws Exceptionиз этих методов?

90
задан user2864740 1 September 2014 в 20:56
поделиться