We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e99fa34 commit 0d8a6b3Copy full SHA for 0d8a6b3
2 files changed
out/production/java-data-structures/TheArrays.class
1.13 KB
src/TheArrays.java
@@ -3,6 +3,27 @@
3
public class TheArrays {
4
5
public static void main(String[] args) {
6
+ String[] footballers = new String[5];
7
+ footballers[0] = "Ronaldo";
8
+ footballers[1] = "Messi";
9
+ footballers[4] = "Lewandowski";
10
11
+ System.out.println(Arrays.toString(footballers));
12
+
13
+ int[] goals = {900, 800, 500};
14
15
+ for (int i = 0; i < goals.length; i++) {
16
+ System.out.println(goals[i]);
17
+ }
18
19
+ for (int i = footballers.length - 1; i >= 0; i--) {
20
+ System.out.println(footballers[i]);
21
22
23
+ for (String footballer : footballers) {
24
+ System.out.println(footballer);
25
26
27
+ Arrays.stream(footballers).forEach(System.out::println);
28
}
29
0 commit comments