Click here to Skip to main content
15,867,704 members
Home / Discussions / Java
   

Java

 
AnswerRe: Need help figuring out why I got a java.lang.NullPointerException. Pin
OriginalGriff9-Jun-21 10:04
mveOriginalGriff9-Jun-21 10:04 
No, we can't - as you say it's "quite a lot" of code - and it needs your data to duplicate the problem.

So, it's going to be up to you.
Fortunately, you have a tool available to you which will help you find out what is going on: the debugger. How you use it depends on your compiler system, but a quick Google for the name of your IDE and "debugger" should give you the info you need.

Put a breakpoint on the first line in the function, and run your code through the debugger. Then look at your code, and at your data and work out what should happen manually. Then single step each line checking that what you expected to happen is exactly what did. When it isn't, that's when you have a problem, and you can back-track (or run it again and look more closely) to find out why.

Sorry, but we can't do that for you - time for you to learn a new (and very, very useful) skill: debugging!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!

GeneralRe: Need help figuring out why I got a java.lang.NullPointerException. Pin
Emmanuel Guerrero9-Jun-21 13:37
Emmanuel Guerrero9-Jun-21 13:37 
QuestionHow should the code, which is the answer to this question, be over the eclipse application in java language? Pin
Özde AKSOY31-May-21 8:43
Özde AKSOY31-May-21 8:43 
AnswerRe: How should the code, which is the answer to this question, be over the eclipse application in java language? Pin
Richard MacCutchan31-May-21 9:13
mveRichard MacCutchan31-May-21 9:13 
QuestionI developed a multiplayer game on my own for the past 6 months Pin
JimieSitu16-May-21 19:00
JimieSitu16-May-21 19:00 
AnswerRe: I developed a multiplayer game on my own for the past 6 months Pin
OriginalGriff16-May-21 19:11
mveOriginalGriff16-May-21 19:11 
AnswerRe: I developed a multiplayer game on my own for the past 6 months Pin
SeanChupas17-May-21 3:00
SeanChupas17-May-21 3:00 
AnswerRe: I developed a multiplayer game on my own for the past 6 months Pin
Gerry Schmitz17-May-21 8:00
mveGerry Schmitz17-May-21 8:00 
AnswerRe: I developed a multiplayer game on my own for the past 6 months Pin
digital seo201128-Jun-21 6:13
digital seo201128-Jun-21 6:13 
Questionhelp figuring out where my code went wrong please Pin
MollyJanet13-May-21 8:32
MollyJanet13-May-21 8:32 
AnswerRe: help figuring out where my code went wrong please Pin
Victor Nijegorodov13-May-21 9:38
Victor Nijegorodov13-May-21 9:38 
AnswerRe: help figuring out where my code went wrong please Pin
Dave Kreskowiak13-May-21 11:04
mveDave Kreskowiak13-May-21 11:04 
GeneralRe: help figuring out where my code went wrong please Pin
SeanChupas14-May-21 2:58
SeanChupas14-May-21 2:58 
AnswerRe: help figuring out where my code went wrong please Pin
Richard MacCutchan13-May-21 21:02
mveRichard MacCutchan13-May-21 21:02 
AnswerRe: help figuring out where my code went wrong please Pin
SeanChupas14-May-21 3:00
SeanChupas14-May-21 3:00 
Questionneed help in javaFX + Maven project structure Pin
Preantas3-May-21 8:50
Preantas3-May-21 8:50 
AnswerRe: need help in javaFX + Maven project structure Pin
Richard MacCutchan3-May-21 21:11
mveRichard MacCutchan3-May-21 21:11 
GeneralRe: need help in javaFX + Maven project structure Pin
Preantas3-May-21 22:27
Preantas3-May-21 22:27 
GeneralRe: need help in javaFX + Maven project structure Pin
Richard MacCutchan3-May-21 22:37
mveRichard MacCutchan3-May-21 22:37 
QuestionHas anyone solved Java exercises in PDF? Pin
Gonzalo Cotanda Gisbert29-Apr-21 5:45
Gonzalo Cotanda Gisbert29-Apr-21 5:45 
AnswerRe: Has anyone solved Java exercises in PDF? Pin
Dave Kreskowiak29-Apr-21 12:26
mveDave Kreskowiak29-Apr-21 12:26 
AnswerRe: Has anyone solved Java exercises in PDF? Pin
Richard MacCutchan29-Apr-21 21:31
mveRichard MacCutchan29-Apr-21 21:31 
GeneralRe: Has anyone solved Java exercises in PDF? Pin
Gonzalo Cotanda Gisbert30-Apr-21 4:51
Gonzalo Cotanda Gisbert30-Apr-21 4:51 
QuestionHow to apply search functionality on jtable if we are fetching the data from DB? Pin
Rocking Kapil16-Apr-21 18:40
Rocking Kapil16-Apr-21 18:40 
QuestionRe: How to apply search functionality on jtable if we are fetching the data from DB? Pin
Richard MacCutchan16-Apr-21 21:51
mveRichard MacCutchan16-Apr-21 21:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.