Top Posters
Since Sunday
j
4
m
4
4
4
n
3
m
3
R
3
V
3
e
3
w
3
j
3
a
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 72 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
this is exactly what I needed
wrote...

Yesterday
This helped my grade so much Perfect
wrote...

2 hours ago
Thanks for your help!!
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  863 People Browsing
Related Images
  
 2718
  
 303
  
 77
Your Opinion
Which industry do you think artificial intelligence (AI) will impact the most?
Votes: 405

Previous poll results: What's your favorite coffee beverage?