This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Well, I'm not sure if this would cause it or not, but you don't have a constructor in game that has no arguements but that is what you are calling in that line. If that's not it, I'm out of ideas.
Joined: Jul 03, 2003
Thanks Matt that worked. I got the program running but it was not running the way it should be so I made some changes to the test class and now I am running into some other troubles.
I am getting a can not resolve symbol that points to the varibale tries: System.out.println ("You threw " + tries + " times and you won " + userplay.getHits()); I think I am getting the error because of the scope of the varibale tries, but I am not sure how to fix it....what do you all think? Thanks Stacey [ July 10, 2003: Message edited by: Stacey ]
declare and intialize the tries variable outside the if condition like int tries =0; and inside the if condition replace the line int tries = Integer.parseInt(JOptionPane.showInputDialog( "How many times would you like to play the with tries = Integer.parseInt(JOptionPane.showInputDialog( "How many times would you like to play the This will surely solve the cannot resolve symbol problem. I hope this helps. Good Luck sj
Hi Stacey, Welcome to JavaRanch, the absolute best site on the www for Java information. We don't have many rules around here, but we do have one. Please change your display name to a first and last name to comply with the JavaRanch Naming Policy. You can change it here. Thank you for your cooperation.
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher