class sup
{ void method() throws Exception {} }
class
test extends sup
{
public static void main(
String [] args) // 1
{
sup s = new test();
s.method();
}
void method() // 2
{}
}
1) Add "throws Exception " clause at line 1
2) Add "throws Exception " clause at line 2
3) Use try catch block while calling s.method()
4) there is no compiler error
5) None of above
answer is 1) and 3)
I am not clear abt why we need to use throws exception clause on line 1
can anybody pls explain.