- 博客(5)
- 收藏
- 关注
原创 ABA问题
如果是基本数据类型基本上都没什么问题,如果是引用类型可能会出问题。打个比方,就像你的前女友找你复合,鬼知道中间她经历了什么。解决方法:加version,每次更改就+1...
2019-11-11 16:06:14 128
原创 java为什么不建议使用String做为锁对象
public class StringSyncTest { public static void main(String[] args) { StringEx stringEx = new StringEx(); StringAThread stringAThread = new StringAThread(stringEx); strin...
2019-11-10 16:58:49 2111
原创 为什么ArrayList删除数据的时候不建议使用remove方法
List<String> list = new ArrayList<String>(); list.add("a"); list.add("b"); list.add("c"); list.add("d"); list.add("e"); for (Strin...
2019-11-10 16:24:53 895
原创 java开启新的线程的方法。。。。
看到好多博客写的有四种或者三种,我看了下Thread源码,官方注解There are two ways to create a new thread of execution.One is to declare a class to be a subclass of <code>Thread</code>.The other way to create a th...
2019-11-08 19:30:40 143
原创 tomcat7及以前的版本怎么把get请求编码格式改成utf-8
因为tomcat7及以前的版本默认编码格式为ISO-8859-1,当我们输入中文的时候会出现乱码。两种方式1.通过request获取参数值String xxx = request.getParameter("xxx");xxx = new String(xxx.getBytes("iso-8859-1","utf-8"));2.改tomcat配置文件修改server.xml...
2019-04-20 13:55:26 557
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人