here is a piece of code that I am working with, however, I want to generate random responses with regards to the strings that I have set up. How best to approach this?
public void run() {
String importantInfo[] = {
"Hello",
"Good day",
"bye",
"farewell"
};
Random random = new Random();
for (int i = 0;
i < importantInfo.length;
i++) {
drop.put(importantInfo[i]);
try {
Thread.sleep(random.nextInt(5000));
} catch (InterruptedException e) {}
}
drop.put("DONE");
}
Aucun commentaire:
Enregistrer un commentaire