I have two arrays :
name[] and roll[]
Is there a way to traverse both arrays in one for each loop.Size of both arrays remain the same.
I know using two individual loops we can traverse and infact in one also its not a big deal, but I want something like this:
for(String n:name,int r:roll){
//blah blah
}
Please shed some light thanks..... Ankur
No. You will have to use the old-fashioned
for(int index = 0; index < name.length; index++) {
//blah blah with name[index] and roll[index]
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With