Code with Finding: |
class SocialNetworkDBAThread {
public void run() {
String cmd;
System.out.println("DBA Thread successfully started.");
System.out.println("To create an A Cappella group, type 'create group'.");
System.out.println("If you don't want to do anything, just leave this alone!");
System.out.println("If at any point you desire to cancel inside a command, just type 'cancel'");
while (true) {
System.out.print(">> ");
try {
cmd = keyboard.readLine().trim();
if (cmd.equals("create group")) {
createGroup();
}
else {
System.out.println("Command not recognized. Type 'create group' to create a new group.");
}
} catch (IOException e) {
System.out.println("Error getting your command! please try again");
continue;
}
}
}
}
|