Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

📚 The CoCalc Library - books, templates and other resources

132930 views
License: OTHER
1
public class World {
2
public static void main(String[] args) {
3
int[] myArray = { 1, 5, 6, 23, 4, 2, -1, 4 };
4
5
// for-Schleife
6
for (int i = 0; i < myArray.length; i++) {
7
System.out.println(myArray[i]);
8
}
9
10
// foreach-Schleife
11
for (int element : myArray) {
12
System.out.println(element);
13
}
14
}
15
}
16
17