This question already has an answer here:
- How do I compare strings in Java? 23 answers
i'm taking user input from
String riddle=b.readLine();
riddle1=Integer.parseInt(riddle);
and obviously, i'm trying to get the user to answer a riddle. I tried using the following
if(riddle1=="answer")
but that doesn't work
Aucun commentaire:
Enregistrer un commentaire