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  
PiMaster314 PiMaster314
wrote...
Posts: 423
4 years ago
What is the output of the following code?

public class Test {
public static void main(String[] args) {
int list[] = {1, 2, 3, 4, 5, 6};
for (int i = 1; i < list.length; i++)
list[i] = list[i - 1];

for (int i = 0; i < list.length; i++)
System.out.print(list[i] + " ");
}
}


▸ 2 3 4 5 6 1

▸ 1 1 1 1 1 1

▸ 1 2 3 4 5 6

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

Introduction to Java Programming, Comprehensive Version


Edition: 10th
Author:
Read 49 times
1 Reply
Replies
Answer verified by a subject expert
austireaustire
wrote...
Posts: 408
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

PiMaster314 Author
wrote...

4 years ago
I appreciate what you did here, answered it right Smiling Face with Open Mouth
dri
wrote...

Yesterday
Helped a lot
wrote...

2 hours ago
Correct Slight Smile TY
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  942 People Browsing
Related Images
  
 1561
  
 259
  
 679
Your Opinion
Who will win the 2024 president election?
Votes: 8
Closes: November 4

Previous poll results: Do you believe in global warming?