0%

  • IntegerCache 中缓存的范围是[-128,127] (但是注释中说 “This method will always cache values in the range -128 to 127, inclusive, and may cache other values outside of this range.”)

  • 只有 Integer.valueOf(x) 函数,会检查 IntegerCache 范围内是否有 x,尝试使用 IntegerCache

  • 自动装箱的 Integer 对象,看下字节码,实际是通过 Integer.valueOf(x) 来初始化的

而在int变量和integer对象比较时:

1
2
int i = 200;
Integer i1 = new Integer(200);

i == i1,将返回true,因为int变量和integer对象比较时,integer将会自动拆箱,所以相当于比较值

总结下Hexo的基本命令。

hexo安装

1
2
3
npm install -g hexo-cli
cd your_blog_dir
npm install hexo@3.8.0

发布文章

1
2
3
4
5
hexo new post "article title"

hexo g

hexo d

其中,后两条可以合并为

1
hexo g -d
阅读全文 »