- 博客(4)
- 收藏
- 关注
转载 深入JVM垃圾回收算法
1. 标记——清除算法(Mark-Sweep)转载自:https://blog.csdn.net/dd864140130/article/details/50084471标记——清除算法是第一种使用和比较完善的垃圾回收算法,算法分为两个过程:1、标记正所有需要回收的对象2、标记完成后清除被标记的对象。其标记的过程就是判断对象有效性,执行可达性分析...
2019-04-19 14:25:02 88
转载 转载 :java四种引用
强引用-FinalReference介绍: 强引用是平常中使用最多的引用,强引用在程序内存不足(OOM)的时候也不会被回收,使用方式:String str = new String("str");1这个str就是强引用。 可用场景: 地球人都知道,但是我讲不出来。软引用-SoftReference介绍: 软引用在程序内存不足时,会被...
2019-04-19 10:01:40 101
原创 方法参数是值传递还是内存地址传递
最近遇到一个题public static void main(String[] args) { StringBuffer s1 = new StringBuffer("A"); StringBuffer s2 = new StringBuffer("B"); fff(s1,s2); System.out.println(s1 + "." + s2); }pub...
2019-04-19 09:34:22 383
原创 java集合判断是否为空的方法
1、Listnull == list与list.isEmpty与list.size() == 0 的区别首先list.isEmpty源码是/** * Returns <tt>true</tt> if this list contains no elements. * * @return <tt>true</tt> if this ...
2019-01-17 13:27:58 3197 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人