How do i implement this interface  
Author Message
gk





PostPosted: 2006-10-2 17:19:00 Top

java-programmer, How do i implement this interface public interface AQuestion
{
public abstract void someMethod() throws Exception;
}




http://www.angelfire.com/or/abhilash/Main.html

see Question no 5.


How do i implement this interface ?

(1) problem is, it has an abstract method and hecne its complicated
to implement this class.

(2) another problem is, it is the public interface and hence we can not
make one more public class in the same file....because 1 file can have
only 1 public access specifier.




is it really possible to implement this interface ?

 
Daniel Dyer





PostPosted: 2006-10-2 17:34:00 Top

java-programmer >> How do i implement this interface On Mon, 02 Oct 2006 10:19:13 +0100, gk <email***@***.com> wrote:

> public interface AQuestion
> {
> public abstract void someMethod() throws Exception;
> }
>
>
> How do i implement this interface ?
>
> (1) problem is, it has an abstract method and hecne its complicated
> to implement this class.

All interface methods are automatically public and abstract, so the
modifiers are redundant. This interface is exactly the same as:

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


> (2) another problem is, it is the public interface and hence we can not
> make one more public class in the same file....because 1 file can have
> only 1 public access specifier.

So put it in another file.

> is it really possible to implement this interface ?

Yes.

Dan.

--
Daniel Dyer
http://www.dandyer.co.uk