Answers for "iterable interface in java"

1

iterable interface in java

List<String> list = new ArrayList><();

list.add("one");
list.add("two");
list.add("three");

Iterator<String> iterator = list.iterator();

while(iterator.hasNext()) {
    String element = iterator.next();
    System.out.println( element );
}
Posted by: Guest on September-10-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language