Westonci.ca offers fast, accurate answers to your questions. Join our community and get the insights you need now. Our platform offers a seamless experience for finding reliable answers from a network of experienced professionals. Discover detailed answers to your questions from a wide network of experts on our comprehensive Q&A platform.

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

Sagot :

Answer:

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