📄 timeclient.java
字号:
// TimeClient.java
// Andrew Davison, June 2003, dandrew@ratree.psu.ac.th
/* Contact the TimeServlet running locally at
http://localhost:8080/servlet/TimeServlet
and print its response.
*/
import java.net.*;
import java.io.*;
public class TimeClient
{
public static void main(String args[]) throws IOException
{
URL url = new URL("http://localhost:8080/servlet/TimeServlet");
BufferedReader br = new BufferedReader(
new InputStreamReader( url.openStream() ));
String line;
while ( (line = br.readLine()) != null)
System.out.println(line);
br.close();
}
} // end of TimeClient class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -