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 33 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
:D TYSM


TheNamesImani

  • Member
  • Posts: 334
Reply 3 on: Yesterday
Wow, this really help

 

Did you know?

Adult head lice are gray, about ? inch long, and often have a tiny dot on their backs. A female can lay between 50 and 150 eggs within the several weeks that she is alive. They feed on human blood.

Did you know?

Although puberty usually occurs in the early teenage years, the world's youngest parents were two Chinese children who had their first baby when they were 8 and 9 years of age.

Did you know?

It is believed that humans initially contracted crabs from gorillas about 3 million years ago from either sleeping in gorilla nests or eating the apes.

Did you know?

Acute bronchitis is an inflammation of the breathing tubes (bronchi), which causes increased mucus production and other changes. It is usually caused by bacteria or viruses, can be serious in people who have pulmonary or cardiac diseases, and can lead to pneumonia.

Did you know?

Amphetamine poisoning can cause intravascular coagulation, circulatory collapse, rhabdomyolysis, ischemic colitis, acute psychosis, hyperthermia, respiratory distress syndrome, and pericarditis.

For a complete list of videos, visit our video library