package com.haoran.lesson; import java.net.InetSocketAddress; public class testport { public static void main(String[] args) { InetSocketAddress inetSocketAddress = new InetSocketAddress("127.0.0.1", 8080); //用来封装端口; System.out.println(inetSocketAddress.getAddress()); System.out.println(inetSocketAddress.getPort()); System.out.println(inetSocketAddress.getHostName()); } }
关于端口封装
最新推荐文章于 2023-05-22 21:11:55 发布