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  
Hpreet796 Hpreet796
wrote...
Posts: 472
4 years ago
In the following code, what is the printout for list2?

class Test {
public static void main(String[] args) {
int[] list1 = {1, 2, 3};
int[] list2 = {1, 2, 3};
list2 = list1;
list1[0] = 0; list1[1] = 1; list2[2] = 2;
for (int i = 0; i < list2.length; i++)
System.out.print(list2[i] + " ");
}
}


▸ 0 1 3

▸ 1 1 1

▸ 0 1 2

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

Introduction to Java Programming, Comprehensive Version


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

Related Topics

Hpreet796 Author
wrote...

4 years ago
Helped a lot
wrote...

Yesterday
This site is awesome
wrote...

2 hours ago
This helped my grade so much Perfect
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  832 People Browsing
Related Images
  
 32
  
 1026
  
 1921