sorsaqwq sorsaqwq
  • 08-01-2022
  • Computers and Technology
contestada

What is wrong with each of the following code segments? int[] values; for (int i = 0; i < values.length; i++) { values[i] = i * i; }

Respuesta :

kenshri1
kenshri1 kenshri1
  • 08-01-2022

Answer:

values have been declared but not initialized nor allocated memory. So you are not allowed to use "values.length"

Answer Link

Otras preguntas

1.) Only the _____ patrons sat in chairs to see a play. a. important b. wealthy c. disabled d. common
how do you add a fraction 4/9 + 1/9 = a.1/3 b .3/9 c.5/9 d.2/3
evaluate d - (-3.5) when d= 2.74
The surface temperature on Venus may approach 737 K. What is this temperature in degrees Celsius? The temperature on Mercury may drop to –265 °F at night. What
Describe three similarities and one difference in the reactions of lithium and potassium with water.
what fraction is equivalent to 36/60
The store manager was ------- when sales dropped for the third year in a row; that was why she ------- our department for its lack of effort. (A) indolent . . i
Discuss the importance of attention to, and a healthy attitude toward, customer recovery. Discuss the difference between assertive and aggressive behavior when
Alex bought twice as many pears as apples. He bought 4 more pears than oranges. He bought 6 apples. How many oranges did Alex buy?
hitler inaccurately associated the concept of an aryan race with all of the following groups except A.ancient Greeks and Romans B.Germans C.Scandinavians D.Jews