我有这门课
class ClientSocketClass {
//connect to IP address 74.125.224.72, TCP port 80
public static java.net.Socket connect1() {
return(new java.net.Socket("74.125.224.72", 80));
}
//connect to www.google.com, TCP port 80
public static java.net.Socket connect2() {
return(new java.net.Socket("www.google.com", 80));
}
}
我有这个错误
error: unreported exception UnknownHostException; must be caught or declared to be thrown
[javac] return(new java.net.Socket("www.google.com", 80));