V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  qgs  ›  全部回复第 2 页 / 共 3 页
回复总数  45
1  2  3  
2022-04-11 09:45:24 +08:00
回复了 followyourheart 创建的主题 Java 单例模式 双检测问题请教
idea 里面在第一个 if 上面,按两次 ctrl + f1 ,会出现解释

Double-checked locking
Inspection info: Reports double-checked locking.
Double-checked locking tries to initialize a field on demand and in a thread-safe manner while avoiding the cost of synchronization. Unfortunately it is not thread-safe when used on a field that is not declared volatile. When using Java 1.4 or earlier, double-checked locking doesn't work even with volatile fields. Read the article linked above for the detailed explanation of the problem.
Example of an incorrect double-checked locking:
class Foo {
private Helper helper = null;
public Helper getHelper() {
if (helper == null)
synchronized(this) {
if (helper == null) helper = new Helper();
}
return helper;
}
}
// other functions and members...
}
2021-07-12 17:03:28 +08:00
回复了 freedom1988 创建的主题 推广 [年中赠书] 送 3 本高级前端程序员面试笔试宝典
分母
2021-07-01 08:41:19 +08:00
回复了 SmartKeyerror 创建的主题 推广 盖楼抽奖 | 感谢 V 站老哥们的认同和鼓励
分母
问同事,感觉这就是 只缘身在此山中
2021-03-10 15:52:34 +08:00
回复了 JasonLaw 创建的主题 编程 使用 MyBatis,怎么优雅地获取到 insert 时自动生成的 id?
官方文档
```
这个例子展示了如何使用 @SelectKey 注解来在插入后读取数据库自增列的值:

@Insert("insert into table2 (name) values(#{name})")
@SelectKey(statement="call identity()", keyProperty="nameId", before=false, resultType=int.class)
int insertTable2(Name name);
```
2021-01-28 19:10:08 +08:00
回复了 CloseToWheat 创建的主题 Java 想学造火箭了,有说明书嘛~
字节 阿里
分母
下一个十年,更好的时代,值得更好的你
这个感觉还不错
2020-10-27 18:53:49 +08:00
回复了 jamfer 创建的主题 推广 回馈 V2,送一把樱桃红轴的 71 键双模机械键盘
末班车
2020-09-29 23:04:59 +08:00
回复了 Young133 创建的主题 Windows 十几分钟一次。“无 Internet,安全”。原地爆炸。
我也有这个问题 1909,不过我的电脑是联想小新 pro13,感觉是电脑的问题
2020-09-19 16:01:36 +08:00
回复了 mingceng 创建的主题 分享创造 我也撸了一个古诗词网站
https://www.xungushici.com/shici/644 这个界面的译文及注释不太对吧
2020-09-01 19:59:25 +08:00
回复了 javaWeber 创建的主题 程序员 请教下这里的事务为什么不回滚。。
2020-05-03 17:34:54 +08:00
回复了 LeeGoeth 创建的主题 程序员 21 届 秋招相关
这个帖子不错,评论区有 pdf 版本,可以打印出来背一背。https://www.nowcoder.com/discuss/344311
2020-04-14 17:24:16 +08:00
回复了 YoungChan 创建的主题 职场话题 求职投简历
本人应届生,一直以为是自己简历的问题,我还用了两个账号投简历
2020-01-16 17:25:36 +08:00
回复了 lyver 创建的主题 推广 除了集五福,咱们春节还能干点啥?(发福利呀~)
分母
2020-01-07 17:31:14 +08:00
回复了 xatest 创建的主题 推广 本码农给老婆的钻戒/珠宝店做下推广,给 V 友们抽几个奖~
分母
1  2  3  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1344 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 39ms · UTC 17:32 · PVG 01:32 · LAX 10:32 · JFK 13:32
Developed with CodeLauncher
♥ Do have faith in what you're doing.