Question

Consider a scenario in an OOP application where a `NullPointerException` (or equivalent) occurs when trying to access a member of an object. What is the most likely cause? 

A The object's constructor was never called.
B The object reference variable is pointing to `null`.
C The class definition is missing a required method.
D The object's data members are all private.
Practice Next

Hey! Ask a query