Top "Nullpointerexception" questions

The Java exception thrown when an application attempts to use null in a case where an object is required.

Hibernate query.list() method is returning empty list instead of null value

When there are no rows, both query.list() and criteria.list() are returning empty list instead of a null value. …

java hibernate collections nullpointerexception return-value
How to handle nulls when using Java collection sort

When using Collection.sort in Java what should I return when one of the inner objects is null Example: Collections.…

java sorting collections nullpointerexception
Best explanation for languages without null

Every so often when programmers are complaining about null errors/exceptions someone asks what we do without null. I have …

programming-languages functional-programming null nullpointerexception non-nullable
getApplicationContext() on a null object reference

I allways get this java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Context android.content.Context.getApplicationContext()' …

android nullpointerexception android-volley android-context
What is dereferencing possible null pointer?

I am making a program for SFTP in NetBeans. Some part of My code: com.jcraft.jsch.Session sessionTarget = null; …

java netbeans nullpointerexception dereference
Why do Double.parseDouble(null) and Integer.parseInt(null) throw different exceptions?

Why do Double.parseDouble(null) and Integer.parseInt(null) throw different exceptions? Is this a historical accident or intentional? The …

java exception nullpointerexception numberformatexception
Unboxing Null-Object to primitive type results in NullPointerException, fine?

This snippet throws an NullPointerException due to the fact that its unboxed to a primitive type and Long.longValue() is …

java nullpointerexception
javax.xml.parsers.FactoryConfigurationError running JBoss AS 7.1 with Java 7 update 171

Upgrading Java from 7u161 to 7u171 prevents JBoss AS 7.1.1.Final from starting. I know JBoss AS 7.1.1 is EOL but for …

java jboss nullpointerexception compatibility
NullPointerExcetion Native Method Accessor... Hashing Words Issue

I am writing a project that reads a file and sorts "Words". This code compiles correctly, yet then it gives …

java hash nullpointerexception native-methods drjava