The following code accomplishes which of the tasks written below? Assume list is an int array that stores positive int values only.int foo = list[0];for (int j =1 ; j < list.length; j++)if (list[j] > foo)foo = list[j];Group of answer choicesit stores the largest value in list (the maximum) in fooit stores the smallest value in list (the minimum) in fooit stores every value in list, one at a time, in foo, until the loop terminatesit counts the number of elements in list that are greater than foo