On 21-2-2005 17:51,
wrote:
> I am trying to "globally" declare an enum so I can use it across a
> large application. This is an example of what I have tried:
>
>
> /** File: TestEnum.java ********/
> public enum TestEnum {
> ONE,
> TWO,
> THREE,
> FOUR;
> }
>
>
> /** File: TestClass.java **********/
> public class TestClass {
> TestEnum number;
>
> public void setNum(TestEnum num) { number = num; }
> public TestClass getNum() { return number; }
^^^^^^^^^
public TestEnum getNum() { return number; }
>
> }
>
> --
>
> The TestEnum is not being recognized as a valid type ("cannot find
> symbol").
>
> Any ideas on a good implementation of this?
>
> Thanks in advance!
>
Return type of getNum() should be TestEnum.
If TestClass.java still doesn't compile (if you still get "cannot find
symbol"), specify your classpath with -classpath option, e.g.:
javac -classpath . TestClass.java
HTH,
--
Regards,
Roland de Ruiter
___ ___
/__/ w_/ /__/
/ \ /_/ / \