This is the string that i use
String [] hi = {"hello","hi","whats up"};
I want the program to display one of the words in the string every time the user types "hi" but my code can't compare the user input and the string
do{
System.out.println("You:");
s.next();
String[] userinput={"hi"};
if(userinput.equals("hi")){
Random r = new Random();
rno = r.nextInt(3);
System.out.println("bot:"+hi[rno]);
}
else{
System.out.println("Bot:Bye");
}
}while(true);
please help