Adding the second line to print Employee name will break our program. As list.next() will return the next Employee object in the list. i.e; first employee number and second employee name will get displayed

Colon (:) refers to in here. So, when we read it, for each Employee object in the collection list, execute the below code. We don't even have to type cast our object as for-each construct will take care of that behind the scenes. We can apply for-each construct to array of elements as well.