Skip to main content

Posts

Showing posts with the label Java Iterator Hackerrank Solution

Java Iterator Hackerrank Solution

 Java Iterator Hackerrank Solution For Explanation Watch Video: Code: import  java.util.*; public   class  Main{          static  Iterator func(ArrayList mylist){       Iterator it=mylist.iterator();        while (it.hasNext()){          Object element = it.next();           if (element  instanceof  String) //Hints: use instanceof operator              break ;         }        return  it;           }     @SuppressWarnings ({  "unchecked"  })     public   static   void  main(String []args){ ...