26th Jan 2024, 12:10 PM
YevaCoder
YevaCoder - avatar
1 Réponse
+ 6
When comparing strings in java, do not use ==. Use String.equals() if(u.equals("Rock")||u.equals("rock")) {ui=0;} else if(u.equals("paper")||u.equals("Paper")) {ui=1;} else if(u.equals("scissor")||u.equals("Scissor")) {ui=2;}
26th Jan 2024, 12:55 PM
Bob_Li
Bob_Li - avatar