Originally posted by Gong James:
//Read the code following and ans the question.
interface AnInterface
{
public void methodOne()throws Exception;
}
class AnInterfaceImp implements AnInterface
{
public void methodOne()throws Exception //This is optional. If you add this here also add this in main() method or enclose the method call in the main() method in a try catch block.
{
System.out.print("I will never throw an exception");
}
}
public class ATest
{
public static void main(String arg[])throws Exception
{
//AnInterface ai=new AnInterfaceImp();]
AnInterfaceImp ai=new AnInterfaceImp();
ai.methodOne();
}
}
Darryl Failla
Sun Certified Java 2 Programmer
Darryl Failla
Sun Certified Java 2 Programmer