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 / March 2007

Tip: Looking for answers? Try searching our database.

InnerClass Help

Thread view: 
Vipin - 22 Mar 2007 07:26 GMT
Hi ALl,
I have an interface and it has innerclass and i want to make use of
this innerclass in some other method in a different file.
how to use it
EX
public interface WRK extends Ser
{
   public enum T{ A(1)
                           ,W(7)
                           ,M(30)
                           ,Y(365);

                            private final int nD;

                            T(int d)
                            {
                              this.nD = d;
                            }

                            public int d()
                            {
                              return this.nD;
                            }
                           };
}

Here i want to make use of enum. how to do it.

Regards
Vipin R.S
Tymoteusz Gedliczka - 22 Mar 2007 12:36 GMT
> Hi ALl,
> I have an interface and it has innerclass and i want to make use of
> this innerclass in some other method in a different file.
> how to use it

refer to the enum this way: WRK.T
then you use:

WRK.T testEnum = WRK.T.W;
etc.
Lew - 23 Mar 2007 13:25 GMT
> Hi ALl,
> I have an interface and it has innerclass and i want to make use of
> this innerclass in some other method in a different file.

You are showing us a nested class, not an inner class.
<http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.1.3>

> how to use it
> EX
> public interface WRK extends Ser

The Java source convention is that only the first letter of each word part is
capitalized except for well-extablished abbreviations like URL, CIA.

> {
>     public enum T{ A(1)
[quoted text clipped - 17 lines]
>
> Here i want to make use of enum. how to do it.


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.