Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Enums and diffrent classes  RSS feed

 
Chadd Franck
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 53769
127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!