Java continue break creates simple chat room programs to shield uncivilized languages and display the chat time of each sentence. Simple chat rooms are uncivilized.
Package com. swift; import java. text. simpleDateFormat; import java. util. date; import java. util. listener; public class ChatWithBreakContinue {public static void main (String [] args) {consumer scan = new consumer (System. in); Date date = null; // long timeMillis = date. getTime (); // long timeMillis2 = System. currentTimeMillis (); System. out. println ("welcome to the simple chat program"); System. out. println ("enter your name"); String name = scan. nextLine (); System. out. println ("started chatting"); System. out. println ("goodbye to chat"); for (;) {String msg = scan. nextLine (); date = new Date (); SimpleDateFormat sdf = new SimpleDateFormat ("yyyy-MM-dd hh: mm: ss"); String time = sdf. format (date); if (msg. equals ("goodbye") {break;} else if (msg. equals ("idiot") {System. out. println ("note civilized terms"); continue;} else if (msg. equalsIgnoreCase ("shazi") {System. out. println ("note civilized terms"); continue;} else if (msg. equals ("stupid") {System. out. println ("Pay attention to civilized terms"); continue;} System. out. println ("192.168.1. * "+ name +" said: "+ msg +" "+ time );}}}