Code Comments
Programming Forum and web based access to our favorite programming groups.I have following code in class A
enum SOMETHING {some1, some2, some3}
Now, i create an object of that class by
A a = new A ();
I wish then to use the values of SOMETHING as follows
... = a.some1;
or
... = a.SOMETHING.some1;
or something similar.
However, the compiler diagrees with me by
"cannot find symbol variable some1"
What do i do uncleaverly?
--
Vänligen
Konrad
---------------------------------------------------
Sleep - thing used by ineffective people
as a substitute for coffee
Ambition - a poor excuse for not having
enough sense to be lazy
---------------------------------------------------
Post Follow-up to this messageOn 6/5/2005 at 4:51:50 AM, Konrad Viltersten wrote:
> I have following code in class A
> enum SOMETHING {some1, some2, some3}
>
> Now, i create an object of that class by
> A a = new A ();
>
> I wish then to use the values of SOMETHING as follows
> ... = a.some1;
> or
> ... = a.SOMETHING.some1;
> or something similar.
>
> However, the compiler diagrees with me by
> "cannot find symbol variable some1"
A.SOMETHING.some1
While you can use an class reference variable (i.e. "a") to qualify
the name of a static field, you cannot use one to qualify then name
of a nested type.
--
Regards,
John McGrath
Post Follow-up to this message>> enum SOMETHING {some1, some2, some3}
>
> A.SOMETHING.some1
>
> While you can use an class reference variable (i.e. "a") to qualify
> the name of a static field, you cannot use one to qualify then name
> of a nested type.
Thanks.
--
Vänligen
Konrad
---------------------------------------------------
Sleep - thing used by ineffective people
as a substitute for coffee
Ambition - a poor excuse for not having
enough sense to be lazy
---------------------------------------------------
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.