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

What is the benefit of completing your exercise all at one time? A. Maintaining a more constant elevated heart rate. B. You burn more calories. C. More muscl
How many Molecules are in 5c4h10
change farmers grow more rice change simple present tense​
What are 2 uses of Nucleic Acid? Cane someone please help me on biology?
The drawing is a scale drawing of a house. An illustration of a house has its height labeled nine inches. If the scale is 2 inches = 4.5 feet, what is the actua
A rectangle measures 3 1/3 inches by 2 1/2 inches what is its area ? Find the area of the last part .
Any process that generates well-defined outcomes is:.
what are the steps to measure the density of a solid?
According to newton, the greater the masses of interacting objects, the.
write few lines about the given picturei will make the brilliant ​