Westonci.ca offers fast, accurate answers to your questions. Join our community and get the insights you need now. Join our platform to connect with experts ready to provide precise answers to your questions in different areas. Our platform offers a seamless experience for finding reliable answers from a network of knowledgeable professionals.

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"