Question?
Q1. Will below program compile?
Q1. Will below program compile?
public class ExceptionTestForInterface implements Type3
{
public void f()
{
System.out.println("Hello World");
}
public static void main(String[] args)
{
Type3 type = new ExceptionTestForInterface();
type.f();
}
}
interface Type1 {
void f() throws CloneNotSupportedException;
}
interface Type2 {
void f() throws InterruptedException;
}
interface Type3 extends Type1, Type2{
}
Ans => Yes, It will compile and successfully print the "Hello World"
Comments
Post a Comment