![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
JavaSe
文章平均质量分 63
小熊熊程序猿
飞一般的思绪。。。
展开
-
Java中String="hello"和new String("hello')两种创建字符串的区别
1.创建String类的对象的两种方式:1. ""直接赋值法2. new关键字法2.两种创建字符串的地址比较String str="hello";String str1="hello";String str2=new String("hello");String str3=new String("hello");此时在创建str的时候会去检查常量池里原创 2017-01-10 13:58:53 · 3172 阅读 · 0 评论 -
ByteBuffer的allocate和allocateDirect
ByteBuffer的allocate和allocateDirect在Java中当我们要对数据进行更底层的操作时,一般是操作数据的字节(byte)形式,这时经常会用到ByteBuffer这样一个类。ByteBuffer提供了两种静态实例方式: Java代码 public static ByteBuffer allocate(int capacity) public static...转载 2019-01-18 01:01:36 · 383 阅读 · 0 评论 -
java NIO 服务器与多客户端双向通信 非阻塞
java NIO 服务器与多客户端双向通信 非阻塞2017年05月25日 20:13:50 奔跑的阳光 阅读数:512 版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_36961530/article/details/72743893服务端代码: import java.io.BufferedReader;...转载 2019-01-16 01:12:34 · 304 阅读 · 0 评论