如何在方法 fillArrayList 中用相应的元素填充两个列表,用户必须输入值
import java.util.ArrayList;
import java.util.Scanner;
class Assignment1
{
public static void main(String[] args)
{
ArrayList<Integer> list1 = new ArrayList<Integer>();
ArrayList<Integer> list2 = new ArrayList<Integer>();
System.out.println("Enter your lists = ");
fillArrayList(list1,list2);
}
public static void fillArrayList(ArrayList<Integer> L1 ,ArrayList<Integer> L2 )
{
//don't know what to do here to fill two lists from the user , really need help
}