So, umm... what's going on here? The main method DOES call getIntegerList method, as well as the getMinimum method (which seems to find the minimum), and it DOES display text on the screen, and it compiles properly. What gives?
package com.codegym.task.task08.task0822;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;
/*
Minimum of N numbers
*/
public class Solution
{
public static void main(String[] args) throws Exception {
List<Integer> integerList = getIntegerList();
System.out.println(getMinimum(integerList));
}
public static int getMinimum(List<Integer> array)
{
int minValue = array.get(0);
for(Integer i : array)
{
if(array.get(i) < minValue)
{
minValue = array.get(i);
i++;
}
}
return minValue;
}
public static List<Integer> getIntegerList() throws IOException
{
Scanner sc = new Scanner(System.in);
List<Integer> list = new ArrayList<>();
int N = sc.nextInt();
for(int i = 0; i < N; i++)
{
list.add(sc.nextInt());
}
return list;
}
}