Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2006

Tip: Looking for answers? Try searching our database.

How do i implement this interface

Thread view: 
gk - 02 Oct 2006 10:19 GMT
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 - 02 Oct 2006 10:33 GMT
> public interface AQuestion
> {
[quoted text clipped - 5 lines]
> (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.

Signature

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



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.