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 many canals run east-west
Caleb bought groceries and paid $1.60 in sales tax. The sales tax rate is 2.5%.
Tin undergoes a synthesis reaction with hydrogen fluoride according to the chemical equation below. How many grams of SnF2, are produced from the reaction of 30
40 decreased by 39 percent
the probability of choosing an apple-flavored juice box out of the refrigerator without looking is 1. which term best describes this probability?a)impossibleb)u
A paint store mixed 4 3/4 cans of paint and 7 2/3 cans of white paint did this mixture make?
There were both PUSH and PULL factors which led to the great migration. select all of the following that were PULL factors. a) racial hatred? b) the rise of
What is absolute value of -3 -6
I don’t get this work I can’t solve it
how can plant reproduction be described?A. Plants reproduce in only one wayB. Plants reproduce in variety of waysC. Plant reproduction has no effect on animalsD