In this session we are discussing:
1)why do we need enhanced for loop if we already have a for loop.
2)enhanced for loop use to iterate values of arrays and collection
Important Points:
This enhanced for loop is used to traverse array or collection in Java
It works on the basis of elements and not the index.
It returns element one by one in the defined variable.
Syntax:
for(data_type variable : array_name)
{
// code block to be executed
}
Note: Do not confuse yourself with collection in upcoming lecture we will discussing the collection.
On this page of the site you can watch the video online #16 Enhanced For Loop | For Each Loop in Java with a duration of hours minute second in good quality, which was uploaded by the user Nilesh Kavankar 21 December 2023, share the link with friends and acquaintances, this video has already been watched 32 times on youtube and it was liked by 2 viewers. Enjoy your viewing!