📅  最后修改于: 2022-03-11 14:52:31.699000             🧑  作者: Mango
Scanner in = new Scanner(System.in);
int n = 5;
ArrayList addName = new ArrayList<>();
for(int i = 0; i < n; i++){
addName.add(in.nextLine());
}