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

In the reaction HCl+NH₂OH → NH₂Cl + H₂O, which compound has an element ratio of 1: 4:1?
A bullet of mass 0.01kg is fired with velocity of [230,0]m/s in to a sack of sand of mass 9.99kg which is swinging from rope. At the moment the bullet hits, the
An object with a mass of 9.0kg has an acceleration of 3m/s the force acting on it is 3n True or false?
a 10-ft vertical post casts a 20-in shadow at the same time a nearby cell phone tower casts a 125-ft shadow. how tall is the cell phone tower?
what do you mean by happiness ???​
What should I Do here? I need steps pls......:)
Each interior angle of a regular polygon is 120°. Find the value of each exterior angle of the polygon.​
Construct a geometric mean between a and c.
Why does the Greenlandic language only have 56,000 speakers?
I don’t think the boss is very ............. to agree