java - "For each" loop for two object -


arraylist<string> date=new arraylist<string>(); arraylist<string> time=new arraylist<string>(); //addition of elements in list ... ... for(string x :date,string y: time) {     system.out.println(x+" "+y); } 

is 2 objects can iterate single "for each" loop? tried above code,i got compilation error. syntax mistake there?

nope, isn't going work. there no way for-each loop; have normal loop either explicit indices or iterators.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -