Top "Nullpointerexception" questions

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

Why use Optional.of over Optional.ofNullable?

When using the Java 8 Optional class, there are two ways in which a value can be wrapped in an optional. …

java java-8 nullpointerexception null optional
Null pointer Exception on .setOnClickListener

I am having an issue with a click listener for a login modal submit button. This is the error. Caused …

java android nullpointerexception onclicklistener
Android: Pass data(extras) to a fragment

I'm new to Android programming and I'm having problems while passing an ArrayList of a Parcelable to a fragment. This …

java android android-intent nullpointerexception
Can't find @Nullable inside javax.annotation.*

I want use @Nullable annotation to eliminate NullPointerExceptions. I found some tutorials on the net, I noticed that this annotation …

java annotations nullpointerexception nullable null-pointer
NullPointerException in Java with no StackTrace

I've had instances of our Java code catch a NullPointerException, but when I try to log the StackTrace (which basically …

java nullpointerexception
JavaFX Location is not set error message

I have problem when trying to close current scene and open up another scene when menuItem is selected. My main …

java nullpointerexception javafx stage
Java 8 NullPointerException in Collectors.toMap

The Java 8 Collectors.toMap throws a NullPointerException if one of the values is 'null'. I don't understand this behaviour, maps …

java nullpointerexception java-8 java-stream collectors
Eclipse / Android : "Errors running builder 'Android Pre Compiler' on project..."

Attempting to do some work on an Android project I haven't worked on for a couple of months, yet every …

android eclipse nullpointerexception adt
Why should one use Objects.requireNonNull()?

I have noted that many Java 8 methods in Oracle JDK use Objects.requireNonNull(), which internally throws NullPointerException if the given …

java java-8 nullpointerexception