[Solved] how to make an virtual chat bot in java? [closed]


If you want to make this with a window you can use a jtextfield and add a actionlistener to it and if you want to make this with the console then use a input

then get the message aka store it in a variable and then do this in your respond method

if(STRINGVARIABLENAME.contains("Your word that you want it to check if it contains")) {
then make the bot respond by Console or just do JTEXTFIELDNAME.setText("ANSWER HERE")
}

and add as many response possibilities by doing a else if after the if like this

if(){
} else if(STRINGVARIABLENAME.contains("")){
}

you can do this as many times as you want and there you have your chat bot 😀

0

solved how to make an virtual chat bot in java? [closed]