| Author |
Enums and diffrent classes
|
Chadd Franck
Ranch Hand
Joined: Nov 05, 2008
Posts: 50
|
|
Is this a legal declaraition? PlayerOne is an Object that extends LifeformTemplate and has a public method called getStat(StatsEnum m) that returns an Integer and a public enum in the LifeformTemplate class called StatsEnum {STR, CON}; Thanks
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32830
|
|
|
Just at a � second look, it looks all right. You are passing a String to a JTextField constructor, which should be OK. You will have to try it to confirm that it shows what you actually want . . .
|
 |
Chadd Franck
Ranch Hand
Joined: Nov 05, 2008
Posts: 50
|
|
|
Yes it did end up being valid, I had some problem elsewhere in my code, I figured it out but don't remember what it was. It was my first time time using enums and I wasn't sure you could access them from another class' method.
|
 |
 |
|
|
subject: Enums and diffrent classes
|
|
|