Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

When java dosent support pointers .then why it throws null pointer exception?

user-image
Question added by basha sk
Date Posted: 2016/01/04

In java Null Objects are used instead of Null Pointers and they Provide an object as a surrogate for the lack of an object of a given type. / The Null Object Pattern provides intelligent do nothing behavior, hiding the details from its collaborators

Gopinath Ramkumar
by Gopinath Ramkumar , Lead Quantitative Manager , Hsbc Securities Services

Pointers are used in Java implementation for references (Oracle JDK is implemented in C++) who develop/implement the language. It is just that pointers are not accessible to developers who use it. So a reference in java is a pointer..

shweta tyagi
by shweta tyagi , Specialist - Backend Development , taqnia

There is a concept of pointers in java. Pointers in Java are known as references . Except int, float, double etc all other non primitive types are reference. They are pointer to a object in heap. Every variable is address of memory location that holds data. when address is zero, it is null pointer and throws null pointer exception

Java support pointers but with different name called reference  .

Note that when we use (.) actually meaning -> in other programing languages .

   

More Questions Like This

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.