You're missing a bracket at the end of the function
import java.util.ArrayList;
public class Main {
public static void main(String[] args) {
ArrayList<Integer> numbers = new ArrayList<>();
for (int i = 1; i < 11; ++i)
numbers.add(i);
display(numbers);
} // this bracket
public static void display(ArrayList arr){
for (int i = 0; i < arr.size(); i++)
System.out.println(arr.get(i) + " ");
System.out.println();
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…