Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > InnerClass Help

Reply
Thread Tools

InnerClass Help

 
 
Vipin
Guest
Posts: n/a
 
      03-22-2007
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

 
Reply With Quote
 
 
 
 
Tymoteusz Gedliczka
Guest
Posts: n/a
 
      03-22-2007
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.
 
Reply With Quote
 
 
 
 
Lew
Guest
Posts: n/a
 
      03-23-2007
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Help Help Pentax S5i Help needed (Please) The Martian Digital Photography 14 06-20-2008 07:56 AM
Does an outer class have access to private elements of its innerclass? Dural Java 4 02-03-2008 07:16 PM
HELP WANTED HELP WANTED HELP WANTED Harvey ASP .Net 1 07-16-2004 01:12 PM
HELP WANTED HELP WANTED HELP WANTED Harvey ASP .Net 0 07-16-2004 10:00 AM
HELP! HELP! HELP! Opening Web Application Project Error =?Utf-8?B?dHJlbGxvdzQyMg==?= ASP .Net 0 02-20-2004 05:16 PM



Advertisments