subject

Do the following two programs produce the same result?
Program I:
public class Test {
public static void main(String[] args) {
int[] list = {1, 2, 3, 4, 5};
reverse(list);
for (int i = 0; i < list. length; i++)
System. out. print(list[i] + " ");
}
public static void reverse(int[] list) {
int[] newList = new int[list. length];
for (int i = 0; i < list. length; i++)
newList[i] = list[list. length - 1 - i];
list = newList;
}
}

Program II:
public class Test {
public static void main(String[] args) {
int[] oldList = {1, 2, 3, 4, 5};
reverse(oldList);
for (int i = 0; i < oldList. length; i++)
System. out. print(oldList[i] + " ");}
public static void reverse(int[] list) {
int[] newList = new int[list. length];
for (int i = 0; i < list. length; i++)
newList[i] = list[list. length - 1 - i];
list = newList;
}
}
A. Yes
B. No

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 00:00
How do we use the sumif formula (when dealing with different formats) ?
Answers: 1
question
Computers and Technology, 23.06.2019 21:30
Examine the list below. which factors positively affect lifetime income? check all that apply.
Answers: 1
question
Computers and Technology, 23.06.2019 22:00
Take a critical look at three gui applications you have used—for example, a spreadsheet, a word-processing program, and a game. describe how well each conforms to the gui design guidelines listed in this chapter.
Answers: 3
question
Computers and Technology, 24.06.2019 01:00
Me if you do then you get 10 points and brainliest
Answers: 1
You know the right answer?
Do the following two programs produce the same result?
Program I:
public class Test {
Questions
question
Mathematics, 28.08.2020 18:01
question
English, 28.08.2020 18:01
question
Mathematics, 28.08.2020 18:01
Questions on the website: 13722363