InnerClass Help

Discussion in 'Java' started by Vipin, Mar 22, 2007.

  1. Vipin

    Vipin Guest

    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
     
    Vipin, Mar 22, 2007
    #1
    1. Advertising

  2. Vipin wrote:
    > 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.
     
    Tymoteusz Gedliczka, Mar 22, 2007
    #2
    1. Advertising

  3. Vipin

    Lew Guest

    Vipin wrote:
    > 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)
    > ,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.
     
    Lew, Mar 23, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?dHJlbGxvdzQyMg==?=

    HELP! HELP! HELP! Opening Web Application Project Error

    =?Utf-8?B?dHJlbGxvdzQyMg==?=, Feb 20, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    805
    =?Utf-8?B?dHJlbGxvdzQyMg==?=
    Feb 20, 2004
  2. Harvey
    Replies:
    0
    Views:
    775
    Harvey
    Jul 16, 2004
  3. Harvey
    Replies:
    1
    Views:
    891
    Daniel
    Jul 16, 2004
  4. =?Utf-8?B?S2ltb24gSWZhbnRpZGlz?=

    HELP - HELP - HELP

    =?Utf-8?B?S2ltb24gSWZhbnRpZGlz?=, Mar 9, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    717
    Eliyahu Goldin
    Mar 9, 2006
  5. Dural
    Replies:
    4
    Views:
    494
    Patricia Shanahan
    Feb 3, 2008
Loading...

Share This Page