This topic contains a solution. Click here to go to the answer

Author Question: Which of the following is correct to create an array? (Read 27 times)

sam.t96

  • Hero Member
  • *****
  • Posts: 570

Question 1

What is the output of the following code?

int[] myList = {1, 2, 3, 4, 5, 6};
for (int i = 1; i < myList.length; i++) {
myList[i - 1] = myList[i];
}

for (int e: myList)
System.out.print(e + " ");

◦ 2 3 4 5 6 6
◦ 6 1 2 3 4 5
◦ 6 2 3 4 5 1
◦ 2 3 4 5 6 1
◦ 1 2 3 4 5 6

Question 2

Which of the following is correct to create an array?
◦ int[] m = {1, 2, };
◦ int[] m = {{1, 2}};
◦ int[] m = {1, 2, 3};
◦ int[] m = {{1, 2}, {3, 4}};


Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
Marked as best answer by sam.t96 on May 6, 2020

ririgirl15

  • Sr. Member
  • ****
  • Posts: 385
Lorsum iprem. Lorsus sur ipci. Lorsem sur iprem. Lorsum sur ipdi, lorsem sur ipci. Lorsum sur iprium, valum sur ipci et, vala sur ipci. Lorsem sur ipci, lorsa sur iprem. Valus sur ipdi. Lorsus sur iprium nunc, valem sur iprium. Valem sur ipdi. Lorsa sur iprium. Lorsum sur iprium. Valem sur ipdi. Vala sur ipdi nunc, valem sur ipdi, valum sur ipdi, lorsem sur ipdi, vala sur ipdi. Valem sur iprem nunc, lorsa sur iprium. Valum sur ipdi et, lorsus sur ipci. Valem sur iprem. Valem sur ipci. Lorsa sur iprium. Lorsem sur ipci, valus sur iprem. Lorsem sur iprem nunc, valus sur iprium.
Answer Preview
Only 39% of students answer this correctly




sam.t96

  • Member
  • Posts: 570
Reply 2 on: May 6, 2020
Excellent


lindahyatt42

  • Member
  • Posts: 322
Reply 3 on: Yesterday
YES! Correct, THANKS for helping me on my review

 

Did you know?

According to the CDC, approximately 31.7% of the U.S. population has high low-density lipoprotein (LDL) or "bad cholesterol" levels.

Did you know?

Long-term mental and physical effects from substance abuse include: paranoia, psychosis, immune deficiencies, and organ damage.

Did you know?

Since 1988, the CDC has reported a 99% reduction in bacterial meningitis caused by Haemophilus influenzae, due to the introduction of the vaccine against it.

Did you know?

The average office desk has 400 times more bacteria on it than a toilet.

Did you know?

Atropine, along with scopolamine and hyoscyamine, is found in the Datura stramonium plant, which gives hallucinogenic effects and is also known as locoweed.

For a complete list of videos, visit our video library