Sunday, 19 May 2013

Exception - 4 -



package net.dharmaraj;

public interface AQuestion 
    { 
        public abstract void someMethod() throws Exception; 
    } 



Read the following code below. 

A Class implementing this interface 
1) Should Necessarily be an abstract class.
2) Should have the method public abstract void someMethod(); 
3) Should have the method public void someMethod() which has to throw an exception which is a subclass of java.lang.Exception.
4) Should have the method public void someMethod() which need not throw an Exception.  

No comments:

Post a Comment