What is wrong with each of the following code segments? a. ArrayList values = new ArrayList(); b.
Question:
What is wrong with each of the following code segments?
a. ArrayList values = new ArrayList();
b. ArrayList values = new ArrayList();
c. ArrayList values = new ArrayList;
d. ArrayList values = new ArrayList();
for (int i = 1; i <= 10; i++)
{
values.set(i - 1, i * i);
}
e. ArrayList values;
for (int i = 1; i <= 10; i++)
{
values.add(i * i);
}
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Question Posted: