For information on how to pass ArrayList variables in JAVA, see
I'm looking it up on the Internet, but
In the line receive(list); below, suppose the elicpse is in red and the argument type is different.
How can I give you a list?
private ArrayList<String>list=new ArrayList<String>();;
public test()
{
list.add("first";
list.add("Second");
receive(list); //eclips show here as red and different types
}
public receive (ArrayList<String>list_test)
{
for(i=0;i<list_test.size();i++){
System.out.println(list_test.get(i));
}
}
Similarly, specifically
publicvoidtest()
and so on
publicvoidreceive(ArrayList<String>list_test)
Then it will be resolved.
© 2024 OneMinuteCode. All rights reserved.