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 are the unit rates for  4/8 , 5/25, 36/6, 14/21, 18/30, 28/16, 56/35, 45/108, 12/42, 39/26
98 divided by 7 please show how
-2n-h(4rx-6s)-3rx+3s i need help doing this problem
What particles make up the nucleus of an atom?
Juan is thinking of two numbers. He says that 3 times the first number minus the second number is 118. In addition, two times the first number plus the second n
the perimeter of a rectangle is 120 meters. If the length of the rectangle is 20 meters more than the width, what are the dimensions of the rectangle.
Find the slope of the ski run that descends 15 feet for every horizontal change of 24 feet
What are the unit rates for  4/8 , 5/25, 36/6, 14/21, 18/30, 28/16, 56/35, 45/108, 12/42, 39/26
What are the unit rates for  4/8 , 5/25, 36/6, 14/21, 18/30, 28/16, 56/35, 45/108, 12/42, 39/26
98 divided by 7 please show how