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

140/96 into a mixed number
Is It Healthy To Eat If Your Not Hungry but Excersice afterwards
What do the Persian and Greek empires have in common
2. If you plot the distance d as an ordinate (y-axis) versus the time of fall t as an abscissa (x-axis), do you expect to get a straight line? What type of curv
What type of stone was used for many tools and weapons?
What particle make up an Atom?? Can you help me?
HELP IN NUMBER 3 plz !!!
Which ordered pair is the best estimate of the solution of the system 3x+y=4 x-3y=4?
An effective thesis statement does all of the following EXCEPT _____. A. state the topic of the essay clearly. B. provide a strong focus for the topic.
To create an educational presentation for patients, a medical assistant would most likely use what?