jeudi 4 août 2016

detecting specific input from user using BufferedReader [duplicate]

This question already has an answer here:

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