当前位置:网站首页>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边栏推荐
- P4408 [noi2003] truant children (tree diameter)
- College degree, what about 33 year old Baoma? I still sell and test, and my monthly income is 13K+
- 程序员SQL数据脚本编码能力弱,BI做不出来怎么办?
- 华为百万聘请数据治理专家!背后的千亿市场值得关注
- Playwright recording
- The performance of major mainstream programming languages is PK, and the results are unexpected
- Which financial products with stable income are good
- Hologres Query管理及超时处理
- ORB(Oriented FAST and Rotated BRIEF)
- Ruby tutorial
猜你喜欢

兩個數相互替換

2022.07.03 (LC 6108 decryption message)

Deux nombres se remplacent

揭露测试外包公司,关于外包,你或许听到过这样的声音

Daily question brushing record (13)

【C】(笔试题)指针与数组,指针

Several simplified forms of lambda expression

OpenHarmony资源管理详解

各大主流编程语言性能PK,结果出乎意料
![[论文阅读] TUN-Det: A Novel Network for Thyroid Ultrasound Nodule Detection](/img/25/e2366cabf00e55664d16455a6049e0.png)
[论文阅读] TUN-Det: A Novel Network for Thyroid Ultrasound Nodule Detection
随机推荐
P4281 [AHOI2008]紧急集合 / 聚会(LCA)
Two numbers replace each other
IT转测试岗,从迷茫到坚定我究竟付出了什么?
Complete knapsack problem (template)
2022.07.03 (LC 6108 decryption message)
The difference between string STR and new string
Enterprise application business scenarios, function addition and modification of C source code
Skills in analyzing the trend chart of London Silver
npm install报错 强制安装
Detailed explanation of openharmony resource management
MySQL uses the explain tool to view the execution plan
程序员SQL数据脚本编码能力弱,BI做不出来怎么办?
1189. Maximum number of "balloons"
全栈开发提效神器——ApiFox(Postman + Swagger + Mock + JMeter)
Consolidated expression C case simple variable operation
大专学历,33岁宝妈又怎样?我照样销售转测试,月入13k+
Netcore3.1 JSON web token Middleware
全网最全正则实战指南,拿走不谢
Actual combat simulation │ JWT login authentication
2022.07.03 (lc_6111_counts the number of ways to place houses)