• Post Reply Bookmark Topic Watch Topic
  • New Topic

trying to initialize deck  RSS feed

 
mikey williams
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am creating the card game "war". This is my first class in the set. I am trying to understand why it will not initialize.
Code:
 
Rico Felix
Ranch Hand
Posts: 411
5
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To initialize your deck you will need to use its constructor...
 
Knute Snortum
Sheriff
Posts: 4274
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You seem have code outside of a method. Putting it in a constructor is one thing you can do -- probably the best.
 
mikey williams
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you for the speedy tips
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!