当前位置:网站首页>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
边栏推荐
- Failed to start component [StandardEngine[Catalina]. StandardHost[localhost]]
- Pre training model parameter mismatch
- JDBC学习(一)——实现简单的CRUD操作
- 简单手写debounce函数
- socke.io长连接实现推送、版本控制、实时活跃用户量统计
- socke. IO long connection enables push, version control, and real-time active user statistics
- @The reason why the Autowired annotation is empty
- Lombok @equalsandhashcode annotation how to make objects The equals () method compares only some attributes
- Syn retransmission caused by IPVS
- OpenGL API learning (2008) client server client server
猜你喜欢

Use of JDBC

Apple MDM bypass jailfree bypass MDM configuration lock free

若依实现下拉框

death_satan/hyperf-validate

Alert pop-up processing in Web Automation

容量调度绝对值配置队列使用与避坑

JQ picture amplifier

AutoCAD C# 多段線小銳角檢測

socke. IO long connection enables push, version control, and real-time active user statistics
![RL practice (0) - and the platform xinchou winter season [rule based policy]](/img/dc/10d615c64123475fea180e035095ff.png)
RL practice (0) - and the platform xinchou winter season [rule based policy]
随机推荐
CAD secondary development +nettopologysuite+pgis reference multi version DLL
Yygh-8-appointment registration
CAD二次开发+NetTopologySuite+PGIS 引用多版本DLL问题
Data center: Seven Swords of data governance
使用SSM框架,配置多个数据库连接
Capacity scheduling absolute value configuration queue usage and pit avoidance
Development trend of mobile advertising: Leveraging stock and fine marketing
Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance
The length of pytorch dataloader the difference between epoch and iteration
AutoCAD C # Polyline Small Sharp angle Detection
Sklearn Feature Engineering (summary)
若依实现下拉框
Install redis on windows and permanently change the password, and integrate redis with the SSM framework
[MySQL] all query tables contain 20million data -- how to optimize SQL
Apple MDM Bypass 免越狱绕过MDM配置锁 免费
idea根据数据库表生成实体类
Introduction to openscap
Jenkins continues integration 2
easyui下拉框选中触发事件
YYGH-BUG-03