Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shavindra/12265cd979f0dee75acd to your computer and use it in GitHub Desktop.
Save Shavindra/12265cd979f0dee75acd to your computer and use it in GitHub Desktop.
public static void enhancedForLoop(){
int[] arr = {1, 2, 3, 4, 5, 6, 7, 8, 9};
System.out.println("\nEXAMPLE: Enhanced For Statement");
for (int temp: arr){ // Create a temporary variable, same type as array values. For
// loop assign array value to the temporary variable
System.out.println("Enhanced = " + temp);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment