网络编程1
    操作ip地址
        核心类 InetAddress
        相关方法 getByName,getAllByName,getLocalHost
    操作socket地址
        由ip地址(或主机名)与端口号组成
        核心类 InetSocketAddress
        相关方法

package java_20180213_api_net;

import java.net.InetAddress;
import java.net.InetSocketAddress; public class InetAddressDemo { public static void main(String[] args) throws Exception {
// InetAddress ia=InetAddress.getLocalHost();
// System.out.println(ia.getHostName());
// System.out.println(ia.getHostAddress()); InetAddress[] ia1=InetAddress.getAllByName("DESKTOP-NMUHAH0");
for (InetAddress inetAddress : ia1) {
System.out.println(inetAddress.getHostAddress());
}
InetAddress ia2=InetAddress.getByName("edu.51cto.com");
System.out.println("edu: "+ia2.getHostAddress()); InetSocketAddress ia3=new InetSocketAddress(80);
}
}

网络编程2
    uri,url,urn的概念
    java中相关的类
        java.net.URI
        java.net.URL
        java.net.URLEncoder
        java.net.URLDecoder

网络编程3
    通过java api访问url的内容

网络编程4
    实现tcp服务器端socket
    实现tcp客户端socket

java8_api_net的更多相关文章

随机推荐

  1. Devexpress的DateEdit控件中DateTime与EditValue异同

    相同: 两者值相同,改变一个值都会引起另一个值做出相应改变. 不同: 1:在界面上对控件的编辑框进行操作时,EditValueChanged事件先响应,DateTimeChanged事件后响应. 2: ...

  2. Python基础学习---位运算符

    <<   左移,每移动1位,相当于乘以2      例如:32<<2    等价于:32*4 ==128 >>   右移,每移动1位,相当于除以2      例如: ...

  3. linux在tomcat中指定jdk

    setclasspath.sh和catalina.sh中写入 export JAVA_HOME=/qbtapp/jdk-8u111-linux-i586/jdk1.8.0_111export JRE_ ...

  4. python爬虫基础_webwechat

    简单的模拟:借用微信网页版,写个扫码页面,登录页面,实现简单的登录.联系人列表.发消息,收消息. 以下是笔记: #!/usr/bin/env python # coding:utf-8 from fl ...

  5. OpenGL绘制一个四边形

    学习自:https://learnopengl-cn.github.io/01%20Getting%20started/04%20Hello%20Triangle/ OpenGL没有直接绘制四边形的a ...

  6. js中bind的用法,及与call和apply的区别

    call和apply的使用和区别不再做阐述,可以参考我的另一篇随笔<JavaScript中call和apply方法的使用>(https://www.cnblogs.com/lcr-smg/ ...

  7. koala 的使用

    koala是一个前端预处理器语言图形编译工具,支持Less.Sass.Compass.CoffeeScript,帮助web开发者更高效地使用它们进行开发.跨平台运行,完美兼容windows.linux ...

  8. c++利用类进行单链表的插入,删除,清空操作

    #if 1 #include <iostream> #include <stdlib.h> #include <time.h> #include <fstre ...

  9. Some notes in Stanford CS106A(4)

    1.x++ is a method , the return value is x. (post increment) ++x is also a method , the return value ...

  10. 网络请求————ProxyHandler实现代理ip

    from urllib import request #这个是没有使用代理的 # resp = request.urlopen('http://httpbin.org/ip') # print(res ...