Top Posters
Since Sunday
5
k
4
c
4
4
M
3
t
3
i
3
B
3
k
3
m
3
c
3
o
3
New Topic  
jujubee600 jujubee600
wrote...
Posts: 467
4 years ago
What is the output of the following code?

int[] myList = {1, 2, 3, 4, 5, 6};

for (int i = myList.length - 2; i >= 0; i--) {
myList[i + 1] = myList[i];
}

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


▸ 1 2 3 4 5 6

▸ 6 1 2 3 4 5

▸ 2 3 4 5 6 1

▸ 6 2 3 4 5 1

▸ 1 1 2 3 4 5
Textbook 
Introduction to Java Programming, Comprehensive Version

Introduction to Java Programming, Comprehensive Version


Edition: 10th
Author:
Read 44 times
1 Reply
Replies
Answer verified by a subject expert
JennyyyJennyyy
wrote...
Posts: 391
4 years ago
Sign in or Sign up in seconds to unlock everything for free
More solutions for this book are available here

Related Topics

jujubee600 Author
wrote...

4 years ago
Thanks
wrote...

Yesterday
I appreciate what you did here, answered it right Smiling Face with Open Mouth
wrote...

2 hours ago
Good timing, thanks!
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  901 People Browsing
Related Images
  
 254
  
 260
  
 266
Your Opinion
Which country would you like to visit for its food?
Votes: 215