Chris Evins, College Student, Schooling, Wolverhampton
Answered Dec 02, 2019
The correct answer to this question is yes, a null reference may be used to access a static variable or method. If used, it will not cause any exceptions. It is not necessary for instances, while static methods or members are being invoked.
This is because static members are home to a class. They do not belong to an instance. In other words, static members share all of the instances in a class, but they do not individually belong to an instance.
This type of question deals with Java, which is a computer programming language. It has been around for over 20 years, debuting in 1995.
The answer is true. Only instance methods or fields need a non-null object reference. Static methods do not even need a reference, but if one exists, it is still independent of all references, even null.