Last active
August 31, 2021 12:06
-
-
Save minte9/07a0dd34b82d1095fff71b551ce583f5 to your computer and use it in GitHub Desktop.
Java / Basics / Loops - https://www.minte9.com/java/basics-loops-1179
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Make a for-each loop and ... | |
* Output all names | |
*/ | |
class LearningApp { | |
public static void main(String[] args) { | |
String[] names = {"John", "Marry", "Ana"}; | |
/** | |
* SOLUTION | |
*/ | |
for (String name : names) { | |
System.out.println(name); // John Marry Ana | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment