Skip to content

Commit b4b08dc

Browse files
authored
bears much fruit
I am the vine. You are the branches. He who remains in me, and I in him, the same bears much fruit, for apart from me you can do nothing. (John 15:5)
1 parent f88f939 commit b4b08dc

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

‎task15/task1514/Solution.java‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
package com.javarush.task.task15.task1514;
2+
3+
//I am the vine. You are the branches. He who remains in me, and I in him, the same bears much fruit,
4+
//for apart from me you can do nothing. (John 15:5)
5+
6+
import java.util.HashMap;
7+
import java.util.Map;
8+
9+
/*
10+
Статики-1
11+
*/
12+
13+
public class Solution {
14+
public static Map<Double, String> labels = new HashMap<Double, String>();
15+
16+
static {
17+
for (int i = 0; i<5; i++) {
18+
String string = "";
19+
string +=i;
20+
labels.put((double)i, string);
21+
}
22+
}
23+
24+
public static void main(String[] args) {
25+
System.out.println(labels);
26+
}
27+
}
28+
29+
30+
31+
32+
33+
34+
/*
35+
Статики-1
36+
В статическом блоке инициализировать labels 5 различными парами ключ-значение.
37+
38+
39+
Требования:
40+
1. В классе Solution должен быть только один метод(main).
41+
2. В классе Solution должно быть объявлено статическое поле labels типа Map.
42+
3. Поле labels должно быть заполнен 5 различными парами ключ-значение в статическом блоке.
43+
4. Метод main должен выводить содержимое labels на экран.
44+
45+
*/

0 commit comments

Comments
 (0)