JAVA的端口
公有端口:0~1023
HTTP:80
HTTPS:443
FTP:21
Telent:23
程序注册端口:1024~49151
tomcat:8080
mysql:3306
orcal:1521
动态或自由端口:49152~65535
package 端口; import java.net.InetSocketAddress; public class TestInetSocketAddress { public static void main(String[] args) { InetSocketAddress inetSocketAddress = new InetSocketAddress("localhost", 443); System.out.println(inetSocketAddress); System.out.println(inetSocketAddress.getAddress()); System.out.println(inetSocketAddress.getHostName()); System.out.println(inetSocketAddress.getPort()); System.out.println(inetSocketAddress.getHostString()); } }