Will somebody help me???? ANYBODY?? PLZZZZZZZZZZZZ
Assume that you have an array of integers named a. Which of these code segments print the same results?
I. int i = 0;
while (i < a.length)
{
System.out.println(a[i]);
i++;
}
II. int i;
for (i = 0; i <= a.length; i++)
{
System.out.println(a[i]);
}
III. for (int i : a)
{
System.out.println(i);
}
I and II only
II and III only
I and III only
All three print the same results.
All three print different results.
Assume that you have an array of integers named a. Which of these code segments print the same results?
I. int i = 0;
while (i < a.length)
{
System.out.println(a[i]);
i++;
}
II. int i;
for (i = 0; i <= a.length; i++)
{
System.out.println(a[i]);
}
III. for (int i : a)
{
System.out.println(i);
}
I and II only
II and III only
I and III only
All three print the same results.
All three print different results.