当前位置:网站首页>Exception handling (I) -- null pointer and array index out of bounds
Exception handling (I) -- null pointer and array index out of bounds
2022-06-28 06:09:00 【Mu Di%】
exception handling
NullPointerException
The most common errors encountered . use debug Step by step jump elimination , Sometimes the parentheses are misplaced , Maybe the parameter in the method is wrong , So you should check carefully when writing , Try to avoid errors caused by null pointer exceptions .

whileAfter the cycle judgment, you should enterforloop , The error in the position of the brackets leads to the final judgment result ofnull, Null pointer exceptionCall in object
getGameId()Method , Comparison is equal , Wrong bookplayer.equals(gameId)Caused null pointer exception

It took me a long time to find out , Only later did I find out that it was if Sentence judgment player2 Have been to null 了 , So call playerDao.addPlayer() I can't add this empty , It is a new entry player
ArrayIndexOutOfBoundsException


The element format does not follow
边栏推荐
- Taobao seo training video course [22 lectures]
- What are the advantages of e-mail marketing? Why do sellers of shopline independent station attach so much importance to it?
- Binder interview: memory management unit
- Filecoin hacker song developer competition
- idea创建类时自动添加注释
- 若依实现下拉框
- Idea automatically adds comments when creating classes
- Oracle condition, circular statement
- YYGH-6-微信登录
- MR-WordCount
猜你喜欢
随机推荐
AutoCAD C# 多段线自相交检测
death_satan/hyperf-validate
AutoCAD C# 多段线小锐角检测
从0配置redis
AutoCAD C# 多段線小銳角檢測
The length of pytorch dataloader the difference between epoch and iteration
Caused by: com. fasterxml. jackson. databind. Exc.invalidformatexception: exception resolution
How popular are FB and WhatsApp mass messages in 2022?
简单手写debounce函数
Academic search related papers
Idea generates entity classes from database tables
Capacity scheduling absolute value configuration queue usage and pit avoidance
异常处理(一)——空指针和数组索引越界
脚本语言和编程语言
Lenovo hybrid cloud Lenovo xcloud, new enterprise IT service portal
深度學習19種損失函數
Failed to start component [StandardEngine[Catalina]. StandardHost[localhost]]
CAD二次开发+NetTopologySuite+PGIS 引用多版本DLL问题
RL practice (0) - and the platform xinchou winter season [rule based policy]
Caused by: com.fasterxml.jackson.databind.exc.InvalidFormatException:异常解决









