自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(4)
  • 收藏
  • 关注

原创 为什么HashMap、HashSet是线程不安全的(JDK 1.8)

1. HashMap<K, V>以put()方法为例,结合JDK源码分析/** * Constructs an empty <tt>HashMap</tt> with the default initial capacity * (16) and the default load factor (0.75). */public HashMap() {...

2020-04-13 14:39:41 961

原创 Fail-fast & Fail-safe

Fail-fast单线程操作iterator时(以ArrayList为例)List<Integer> integers = new ArrayList<>();integers.add(1);integers.add(2);integers.add(3);/** fail-fast in Iterator* Throw ConcurrentModificat...

2019-12-10 11:45:50 153

原创 String vs StringBuffer vs StringBuilder

可变性String 对象不可变。当给 String 引用赋予变化时,会创建新的 String 对象,原字符串对象失去引用。String 类中使用 final 关键字修饰字符数组来保存字符串,private final char value[]StringBuffer & StringBuilder 对象可变。它们均继承自 AbstractStringBuilder 类,在 Abst...

2019-11-30 17:21:42 196

转载 Rust - Getting Started

Rust - Getting StartedInstalling Rust on MacOsProject and Package ManageHello RustA simple application with dependencyInstalling Rust on MacOsRustup: the Rust installer and version management tool....

2019-11-17 17:01:41 184

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除