Duration: 90 minutes
Instructions: You need to know at least one programming language to perform reasonably well on certain exam questions.
Question 1 (3 points): Review the following method and find (at least) 5 issues in the code (i.e.,coding practice, compile errors, potential logical issues, etc.) (Use question I template)
public ArrayList<Integer> vicDiff(int[] ar1, int[] ar2) {
1234 2 3
4
5
6
7
8
9
10
11
12
13
ArrayList<Integer> Output = null;
int[] ar1 = {};
boolean found;
if(ar1 != null && ar2 != null) {
Output = new ArrayList<Integer>();
for(int item: ar1){
int i;
found = false;
System.out.println(found);
while(i <= ar2.length && found = false) {
if(item ar2[i])
found = true;
Zoom
+ 100%
Close