livimal77
15.10.2019 •
Computers and Technology
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] + " "); } }
a. 1 2 3
b. 1 1 1
c. 0 1 2
d. 0 1 3
Solved
Show answers
More tips
- F Food and Cooking How to Set Up Ventrilo - The Ultimate Guide...
- L Leisure and Entertainment How to Make a Crab Trap in Just a Few Minutes...
- H Health and Medicine How Much Does Abortion Cost? Expert Answers and Insights...
- S Sport How to Build Arm Muscles? Effective Exercises and Tips...
- H Health and Medicine When can it be said that a person has a normal pulse?...
- A Art and Culture When Will Eurovision 2011 Take Place?...
- S Style and Beauty How to Choose the Perfect Hair Straightener?...
- F Family and Home Why Having Pets at Home is Good for Your Health...
- H Health and Medicine How to perform artificial respiration?...
- H Health and Medicine 10 Tips for Avoiding Vitamin Deficiency...
Answers on questions: Computers and Technology
- C Computers and Technology The term refers to the use of a single unifying device that handles media, internet, entertainment, and telephone needs....
- C Computers and Technology James is creating a presentation for his class. The presentation includes photos of his classmates throughout the year. He would like some of the photos to fit inside shapes....
- H History Setihsurenescribe six ways in which theimpressed his...
- E English Why are stereotypes often inaccurate and harmful ?...
- M Mathematics Jumma Mubarak to all Muslim...
- P Physics Solve these 5 items in your notebook and take a clear and readable photo. PS. You need to balance the equation before u identify the type of chemical reaction....
- C Computers and Technology What is the full form of windows xp...
- E English What role does sexuality play within the novel In Cold Blood ?...
- S Social Studies ANYONE HEREWHO BUYS OR SELLS BITCOIN OR IS BITCOIN MINER ?...
- C Chemistry Step 4: How many of each type of atom should react so that the electrons lost will equal the electrons gained? A. one potassium and one iodine B. two potassium and one iodine...
Ответ:
C. 0 1 2.
Explanation:
As we know that in Java arrays are created dynamically.In this problem we are first assigning the array {1,2,3} and it's reference is assigned to list1. When we write list2=list1 now list will be referencing the same array as the list1. So any changes made to list1 will be reflected to the list2 reference also.
Ответ: