unchecked Exception no issues in method overriding
//source code unchecked exceptions in method overriding
package oops;
class Parentclass
{
public void sm()
{
System.out.println("super class");
}
}
public class OREx extends Parentclass{
public void sm()throws RuntimeException //no error
// In case of unchecked exceptions no issues
{
System.out.println("sub class");
}
public static void main(String a[])throws Exception
{
OREx s=new OREx();
s.sm(); // sub class
}
}
0 comments:
Post a Comment