PART 2 - DIRECTIONS : Write a return method named run that returns an integer. run takes in one parameter which is an list of integers named one. run will return the sum of all even values greater than 5 in the list one .
The call run( [ 3, 4, 5, 6, 7, 8, 9] ) would return 14
What is output by the code below?
List<String> list = new ArrayList<String>();
list.add("it");
list.add("up");
list.add("go");
System.out.println(list);
[go, up, it]
[it, up, go]
[go]
[up]
it, up
What is output by the code below?
List<Integer> list = new ArrayList<Integer>();
list.add(8);
list.add(5);
list.add(6);
list.remove(0);
System.out.println(list);
[8, 5, 6]
[5, 6, 8]
[5, 6]
[8, 6]
[8, 5]
Question 3: What is output by the code below?
List<Integer> list = new ArrayList<Integer>();
list.add(8);
list.add(5);
list.add(6);
list.remove(2);
System.out.println(list);
[8, 5, 6]
[5, 6, 8]
[5, 6]
[8, 6]
[8, 5]
Question 4: What is output by the code below?
List<Integer> list = new ArrayList<Integer>();
list.add(8);
list.add(2);
list.add(5);
list.add(6);
list.add(9);
list.remove(0);
System.out.println(list);
[2, 5, 6, 9]
[2, 6, 8, 9]
[5, 6, 9, 8]
[5, 6, 8, 9]
[2, 9, 8, 5]
Question 5: What is output by the code below?
ArrayList list = new ArrayList();
list.add("it");
list.add("go");
list.add("up");
System.out.println(list.get(0));