介绍java中Pair second_Java基础知识

一、静态类

1、

问:Java中静态类为什么也可以实例化

答:static修饰的类不是说它自己是静态类,而是说它是外部类的静态成员。

二、在Java中创建UUID随机数

java.util.UUID.randomUUID();

三、Map

四、反射

五、BigDecimal

六、java html 编解码

String escaped = StringEscapeUtils.escapeHtml3(stringToEscape);

String escaped = StringEscapeUtils.escapeHtml4(stringToEscape);

unescapeHtml3

unescapeHtml4

在APACHE的COMMON包里

七、java 过滤 html

八、排序

对任意类型集合对象进行整体排序,排序时将此接口的实现传递给Collections.sort方法或者Arrays.sort方法排序.

实现int compare(T o1, T o2);方法,返回正数,零,负数各代表大于,等于,小于。

九、字节占位

十、字节数组转换为String

public static void main(String[] args) throwsException{

ByteArrayOutputStream baos= newByteArrayOutputStream();

String str="zhangbin";

ByteArrayInputStream bais= new ByteArrayInputStream(str.getBytes("UTF-16"));int ch=0;while((ch = bais.read()) != -1){ //读到尾部返回-1

baos.write(ch); //一个字节一个字节再写入到baos中

}

System.out.println("UTF-8结果:" + baos.toString()); //默认编码UTF-8

System.out.println("UTF-16结果:" + baos.toString("UTF-16"));//byte[] bytes = baos.toByteArray();//String xml = new String(bytes, "GB2312");//return xml;

}

十一、多线程

十二、配对-Pair

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值