Connection method
//
服务例程:读出一行文本;反转文本;返回文本。
public void run()
{
String line;
StringBuffer revline;
int len;
try
{
for(;;)
{
// Read a line
line = in.readline();
if(line
== null) break;
// Reverse the line
len = line.length();
revline = new
StringBuffer(len);
for(int i = len-1; i >=0; i--)
revline.insert(len-1-I;line.charAt(i));
// Write out the reverse line
out.println(revline);
}
catch(IOException e);
finally try client.close();
catch(IOException e2);
}
// End of run method
}
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/