You can test this code here: online java tester
import java.util.ArrayList;
public class HelloWorld
{
public static void main(String[] args)
{
ArrayList<String> arry = new ArrayList<>();
arry.add(new String("test1"));
arry.add(new String("test2"));
arry.add(new String("test3"));
//foreach
for(String value : arry) {
System.out.println(value);
}
}
}
public class HelloWorld
{
public static void main(String[] args)
{
ArrayList<String> arry = new ArrayList<>();
arry.add(new String("test1"));
arry.add(new String("test2"));
arry.add(new String("test3"));
//foreach
for(String value : arry) {
System.out.println(value);
}
}
}