public MyClass(Integer userId, Integer otherId) {
if(!userId.equals(otherId)){
this.userId = userId;
this.otherId = otherId;
}
}
Run Code Online (Sandbox Code Playgroud)
就我而言,我想确保一个实例,如果永远不会创建匹配的ID?
| 归档时间: |
|
| 查看次数: |
176 次 |
| 最近记录: |