Is it possible to combine multiple for loops into one loop in Java?
e.g, I have
for (i : lista)
{
//do something
}
for (j : listb)
{
//do something
}
is it possible to combine both in one?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I think your question only makes sense when lista and listb are of equal size, right?
Then you could say something like