Bucle for-each en java

in #spanish7 years ago (edited)

Bucle for-each en java

Apartir de java 5 se incorporó el bucle for-each en java, este nos permite recorrer un collection o un arreglo de elementos de una forma mucho más sencilla. Veamos unos ejemplos para el uso de for-each con el recorrido de arreglo, matrices y objetos:
Ejemplo for-each con arreglos:

for-each arreglo.jpg
Ejemplo for-each con matrices:

for-each matriz.jpg
Ejemplo for-each con Objetos:

for-each obejtos.jpg

Gracias a todos por leer…



Sort:  

Congratulations! This post has been upvoted from the communal account, @minnowsupport, by neliobatis from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, theprophet0, someguy123, neoxian, followbtcnews, and netuoso. The goal is to help Steemit grow by supporting Minnows. Please find us at the Peace, Abundance, and Liberty Network (PALnet) Discord Channel. It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.

If you would like to delegate to the Minnow Support Project you can do so by clicking on the following links: 50SP, 100SP, 250SP, 500SP, 1000SP, 5000SP.
Be sure to leave at least 50SP undelegated on your account.

Coin Marketplace

STEEM 0.18
TRX 0.15
JST 0.029
BTC 62066.10
ETH 2419.11
USDT 1.00
SBD 2.66