Forums Register Login

I keep getting null

+Pie Number of slices to send: Send
Ok I’m working on a homework assignment to make a rock paper scissors game. I have made the main file and now I’m working on the class file. When I try to get it where value == 1 then pick = “Rock” and so on.
Then I want to output what pick is. I get null? Why? Here is my code.




Thank you for any help on this.
+Pie Number of slices to send: Send
Apparently the value is not 1. I'd start by examining what value it has, maybe by inserting another System.out.println statement.
+Pie Number of slices to send: Send
DoYourOwnHomework .
dude, Ask question yourself what could be the reason ? and list out your understanding; and not able to figure out ? approach your teacher . your teacher is not able to answer? ... definitely she/he should know about this assignment . in case she/he dont know the clue. come back we will give you a hint

+Pie Number of slices to send: Send
Check when you're setting the value of pick. In which methods is it set, and when are those methods called.
+Pie Number of slices to send: Send
Im sorry i forgot to enter all of the code the first time. here is the class Game file again with all if statements.

+Pie Number of slices to send: Send
You apparently haven't done this yet:

Rob Spoor wrote:Check when you're setting the value of pick. In which methods is it set, and when are those methods called.

 
Amateurs built google. Professionals built the titanic. We can't find the guy that built this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 912 times.
Similar Threads
using Arrays to store info
help with parameter passing
what could be the modifiers of this ?
Sending data from an ArrayList to a file
constructor's call
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 10:01:46.