dev
Answered On : Dec 11th, 2011
No, When super class method throws exception then subclass does not throws the same Exception

1 User has rated as useful.
Login to rate this answer.
Yes, we can
Code
package sample;
class Super {
{ System.
out.
println("Super");
}
}
class SupSub extends Super {
{
}
}
public class super123{
public static void main
( String[] argv
) {
SupSub sup=new SupSub();
Super spr=new SupSub();
spr.foo(); // Output SupSub }
}
}
Login to rate this answer.
Here foo can skip adding throws NullPointerException because is an unchecked exception
class SupSub extends Super {
void foo()throws NullPointerException
{
System.out.println("SupSub");
}
}
Login to rate this answer.
Yes we can ..sub class can throw same or subclass of that exception
Login to rate this answer.