Computer Science, asked by Mihy7114, 10 months ago

When a Java array will throw NullPointerException?

Answers

Answered by vasantinikam2004
0

A null pointer exception is thrown Whenever you try to

Call the instance method of a null object.

Access, modify, print, a null value.

Trying to access (print/use in statements) the length of the null value.

Throw a null value.

Access an element of an array without initializing it.

Then, a Null Pointer Exception will be thrown.

Plz mark as brainlist......

Answered by bossrc64p7l5et
0

NullPointerException is thrown when an application attempts to use an object reference that has the null value. These include: Calling an instance method on the object referred by a null reference.

Similar questions