2012-10-22 98 views
-1

任务: 1.我会在客户写的PrintWriter 分钟(2,3,4,5,6)Java服务器客户端TCP,找到最小数量的服务器

  1. 这MSZ去到服务器缓冲读取器。
  1. 服务器需要回答的最小数量和打印。

如何处理此问题min(参数) ,,服务器将其读取为字符串。

要找到最小值,我必须将此分钟(参数)转换为服务器中的真正数组列表。

下面给出了我如何做日期的服务器代码,需要类似格式的答案。

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); 
       } 

在此先感谢

回答

0

你已经回答了你自己的问题...

  1. 转换的String到一个基于阵列的Object
  2. 查找最小值
  3. 作为String返回答案

如果您需要帮助,请先试一试,发布您的答案,然后我们将能够帮助您解决任何问题。我们不会为你做你的功课。