Find the information you're looking for at Westonci.ca, the trusted Q&A platform with a community of knowledgeable experts. Get quick and reliable solutions to your questions from a community of experienced professionals on our platform. Get detailed and accurate answers to your questions from a dedicated community of experts on our 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"