   [java] Java print out null
  Hello!I am experiencing a little problem. I am currently finishing my game, and I am experiencing an error infrequently. I can run the game correctly many times, but sometimes Java prints out a null to the text output and the game will run further but the screen is not updating, and I can't really do anything. I just can't find out what this 'error' means.Any ideas?   
  It sounds like something is throwing a NullPointerException, which you have in a try/catch blocks, although the catch block is probably empty or not doing what it's meant to do so when the Exception is thrown your game just stops.Try putting System.out.println(ex); in all your catch blocks and see if it prints out an exception when it also prints out "null."I guess you are calling System.out.println(someobject); and where it would normally print out someobject.toString() the object is invalid so it's just printing "null."  Look around for cases where you might have done that, it might give you an idea as to what is causing the problem.Good luck!   ;  Hi, thank your the fast reply, I've tried what you've said, it is between a try-catch block, and I've taken out all System.out.println -s from my project. Still happens rarely, and that's what is strange to me, how come this error only happens infrequently? Actually, I forgot to mention, that it happens when I start the program, no difference between two "startups". Sometimes happen, sometimes not. :s   ;  Which IDE are you using? If you use Eclipse you could make an Exception Breakpoint. Try Debugging your game and add an Exception Breakbpoint for NullPointerException. That might help you catch the cause of the exception.BTW, what do you mean with text output? Is that your console e.g. the place where tour System.out's print to? If it is still printing null there are probably still System.out's hanging around. Maybe in any third party libraries you're using?;  Its you game Swing based?   ;  This is probably a null reference somewhere in your code. You may not have initiallized something. NullReferenceException extends RuntimeException, which is the only type of exception that is not checked at runtime. An unhandled NullReferenceException will unroll up and out of the thread in which it occurs, and then be printed to System.err (and now System.out). It must be in your render loop somewhere, so it is killing your rendering thread but not killing the Swing (or AWT) worker process.   