autumn1595 autumn1595
  • 24-02-2020
  • Computers and Technology
contestada

If you're getting a NullPointerException, remember that it is a perfectly valid use-case to have the constructor argument be null. What should happen in this case?

Respuesta :

colocho08
colocho08 colocho08
  • 01-03-2020

Answer:

Explanation:

NullPointerException is a RuntimeException. En Java, this happens when an application try to use a reference but this is null, this is used just to create an object, because an object references cannot exist without a value, so we assign the null value to it, but no object is created and the compiler does not detect it.

For example

Object obj = null;

obj.toString();  // This statement will throw a NullPointerException

Answer Link

Otras preguntas

Why did Senator Vandenberg oppose the policy of cash and carry?.
An increase of 50 dB increases the sound intensity by a factor of
The area of a rectangular city park is 25/54 square miles. The length of the park is 5/9 mile. What is the width, in miles, of the park?
is 25 milligrams lighter or heavier than 25 centigrams
Why did japan change sides during ww1 & ww2
i have a quiz, help me plz! Which describes an action of Caesar Augustus? A. He plunged the Roman world into a civil war. B. He established an imperial governme
what would happen to temperatures on earth the suns heat were distributed throughout the atmosphere
What would happen to and its offspring if the cells did not go through a G1 phase during their cell cycle
Fingerprints cannot be used to identify particular people. True False
Which equation has the same solution as 2x^2+x-3=0