Which method is used to check whether the Collection has next element or not? code example
Example: java iterator example
Iterator iterator = list.iterator();
System.out.println("List elements : ");
while (iterator.hasNext())
System.out.print(iterator.next() + " ");