Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

If there are no pointers in Java, then why do we get NullPointerException?

Pragya Keshap answered on February 4, 2023 Popularity 3/10 Helpfulness 1/10

Contents


More Related Answers

  • ARE THERE POINTER IN JAVA
  • null pointer exception
  • pointers in java
  • java catching nullpointerexception
  • java pointer
  • Fix NullPointerException
  • java.lang.nullpointerexception
  • SET TO NULL pointer c++
  • spring environment null pointer exception
  • nullpointerexception
  • nullpointerexception
  • NullPointerException
  • NullPointerException
  • NullPointerException
  • Why there are no pointers in Java?
  • resolve null pointer exception java 8
  • NullPointerException
  • how to use a try catch for a null pointer exception in java
  • nullpointerexception

  • If there are no pointers in Java, then why do we get NullPointerException?

    0

    In Java, the pointer equivalent is Object reference.

     When we use a . it points to object reference.

     So JVM uses pointers but programmers only see object references.

    In case an object reference points to null object, and we try to access a method or member variable on it, then we get NullPointerException.

    https://www.geeksforgeeks.org/null-pointer-exception-in-java/

    Popularity 3/10 Helpfulness 1/10 Language java
    Source: Grepper
    Tags: get java pointers
    Link to this answer
    Share Copy Link
    Contributed on Feb 04 2023
    Pragya Keshap
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.