Task:
1. I will write in clients printwriter min(2,3,4,5,6)
- this msz goes to servers buffered reader.
- server needs to answer the minimum number and print.
how to deal with this min(parameters) ,, server reads it as string.
to find minimum, i have to convert this min(param.) into a real arraylist in server.
Server code of how i did the date is given below, want answer in similar format.
if (msgFromClient != null && msgFromClient.equalsIgnoreCase("DATE()")) {
OutputStream clientOut = client.getOutputStream();
PrintWriter pw = new PrintWriter(clientOut, true);
DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd");
Date date = new Date();
System.out.println(dateFormat.format(date));
String ansMsg = dateFormat.format(date);
pw.println(ansMsg);
}
Thanks in advance
You’ve already answered your own question…
Stringinto an array-basedObjectStringIf you want help, give it a try first, post your answer, and then we’ll be able to help correct any problems. We’re not going to do your homework for you.