?? daywatch.txt
字號(hào):
import java.net.*;
public class DayWatch
{
private DatagramSocket ds;
private DatagramPacket dp;
public static void main(String args[]) throws Exception
{
DayWatch d = new DayWatch();
d.go();
}
public void go() throws Exception
{
...;//長(zhǎng)度為64的字節(jié)型數(shù)組
String s;
ds =...;//新建數(shù)據(jù)報(bào)套接字
dp =...;//構(gòu)造一個(gè)接收數(shù)據(jù)報(bào)
...//循環(huán)
{
...;//接收數(shù)據(jù)報(bào)
...;//將接收數(shù)據(jù)報(bào)中的數(shù)據(jù)轉(zhuǎn)換為字符串
System.out.println("Time signal received form " +/*接收數(shù)據(jù)報(bào)的地址*/ + "\n Time is: " + /*接收到的字符串*/);
}
}
}
javac
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -