当前位置:网站首页>Check if this is null - checking if this is null
Check if this is null - checking if this is null
2022-07-05 00:49:00 【Superior virtue and weak water】
problem :
Does it ever make sense to check if this is null? Check this Whether it is empty or meaningful ?
Say I have a class with a method; Suppose I have a class with methods ;inside that method, I check this == NULL , and if it is, return an error code. In this method , I check this == NULL , If it is , The error code is returned .
If this is null, then that means the object is deleted. If this It's empty. , Then this means that the object is deleted .Is the method even able to return anything? Can this method even return anything ?
Update: I forgot to mention that the method can be called from multiple threads and it may cause the object to be deleted while another thread is inside the method. to update : I forgot to mention that this method can be called from multiple threads , It may cause the object to be deleted , Another thread is inside the method .
Solution :
Reference resources : https://stackoom.com/en/question/7ji1边栏推荐
- 【C】(笔试题)指针与数组,指针
- 107. SAP UI5 OverflowToolbar 容器控件以及 resize 事件处理的一些细节介绍
- The performance of major mainstream programming languages is PK, and the results are unexpected
- 潘多拉 IOT 开发板学习(RT-Thread)—— 实验4 蜂鸣器+马达实验【按键外部中断】(学习笔记)
- Oracle case: SMON rollback exception causes instance crash
- SAP UI5 应用开发教程之一百零六 - 如何提高 SAP UI5 应用路由 url 的可读性试读版
- GDB常用命令
- Upload avatar on uniapp
- P4408 [noi2003] truant children (tree diameter)
- Apifox (postman + swagger + mock + JMeter), an artifact of full stack development and efficiency improvement
猜你喜欢

Skills in analyzing the trend chart of London Silver

URLs and URIs

leetcode494,474

Several simplified forms of lambda expression
![P3304 [sdoi2013] diameter (diameter of tree)](/img/5c/984675bf4517481f80f54657c6c7ad.png)
P3304 [sdoi2013] diameter (diameter of tree)

Hill sort of sorting

“薪资倒挂”、“毕业生平替” 这些现象说明测试行业已经...

ORB(Oriented FAST and Rotated BRIEF)

What you learned in the eleventh week

skimage: imread & imsave & imshow
随机推荐
[selenium automation] common notes
创新引领方向 华为智慧生活全场景新品齐发
IT转测试岗,从迷茫到坚定我究竟付出了什么?
[论文阅读] TUN-Det: A Novel Network for Thyroid Ultrasound Nodule Detection
Maximum number of "balloons"
lambda expressions
Paper notes multi UAV collaborative monolithic slam
多模输入事件分发机制详解
Acwing164. Accessibility Statistics (topological sorting +bitset)
Two numbers replace each other
【C】 (written examination questions) pointer and array, pointer
MySQL uses the explain tool to view the execution plan
Playwright之录制
ORB(Oriented FAST and Rotated BRIEF)
ORB(Oriented FAST and Rotated BRIEF)
两个数相互替换
2022.07.03(LC_6111_统计放置房子的方式数)
leetcode494,474
1189. Maximum number of "balloons"
有哪些收益稳定的理财产品,这两个都不错