import java.util.Vector; Vectorvector = new Vector<>(); vector.add("Apple"); vector.add("Orange"); vector.add("Banana");
for (String fruit : vector) { System.out.println(fruit); }
Apple Orange BananaThe enhanced for loop is used to iterate over the elements in the vector. Each element is assigned to the `fruit` variable in turn, and then printed to the console. The java.util package contains many useful classes for working with collections in Java, including ArrayList, LinkedList, and HashSet.