Tutorials Shared by the Internet Community
|Top Tutorials||New Tutorials||Submit||Login||Register|
Tutorial Basic Detail
Total Hits: 13161
Total Votes: 140 votes
Average Rating: 3.82 out of 5
Category: JAVA/Core JAVA
Description:Java.lang.NullPointerException comes when we try to access any field or method on Object which is null. Its come mainly due to programming mistake and breaking of contract between different part of application but there are few cases where you can avoid NullPointerException in Java by carefully coding like instead of object.equals("apple) you can call "apple".equals(object) which will not throw NullPointerException.