import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
public class Main {
public static void main(String[] args) {
// Usando ArrayList
List<String> arrayList = new ArrayList<>();
arrayList.add("Elemento 1");
arrayList.add("Elemento 2");
arrayList.add("Elemento 3");
System.out.println("ArrayList:");
for (String elemento : arrayList) {
System.out.println(elemento);
}
// Usando LinkedList
List<String> linkedList = new LinkedList<>();
linkedList.add("Elemento 1");
linkedList.add("Elemento 2");
linkedList.add("Elemento 3");
System.out.println("LinkedList:");
for (String elemento : linkedList) {
System.out.println(elemento);
}
}
}