質問編集履歴

3

指摘の修正

2018/05/08 02:54

投稿

flumchaso
flumchaso

スコア15

test CHANGED
File without changes
test CHANGED
@@ -48,7 +48,7 @@
48
48
 
49
49
 
50
50
 
51
- private int class;//組
51
+ private int kumi;//組
52
52
 
53
53
  private int no;//番号
54
54
 
@@ -58,7 +58,7 @@
58
58
 
59
59
 
60
60
 
61
- public ParamClass(String substring, boolean b, int i) {
61
+ public Test(int i1, int i2, String s, boolean b) {
62
62
 
63
63
  // TODO 自動生成されたコンストラクター・スタブ
64
64
 

2

一部修正

2018/05/08 02:54

投稿

flumchaso
flumchaso

スコア15

test CHANGED
File without changes
test CHANGED
@@ -48,13 +48,13 @@
48
48
 
49
49
 
50
50
 
51
- private int class;
51
+ private int class;//組
52
52
 
53
- private int no;
53
+ private int no;//番号
54
54
 
55
- private String name;
55
+ private String name;//氏名
56
56
 
57
- private boolean flg;
57
+ private boolean flg;//委員長フラグ
58
58
 
59
59
 
60
60
 

1

一部情報追加

2018/05/08 01:25

投稿

flumchaso
flumchaso

スコア15

test CHANGED
File without changes
test CHANGED
@@ -3,6 +3,8 @@
3
3
 
4
4
 
5
5
  Java8であるList<Test>の型で宣言された変数にデータが格納されていて、そのデータから値を取得したい。
6
+
7
+ 以下、試したこと内の第2引数部分が1のデータを取得する。
6
8
 
7
9
 
8
10
 
@@ -18,7 +20,7 @@
18
20
 
19
21
  ~中略~
20
22
 
21
- testList.add(new Test(1, "tanaka", false));//データは複数あるが、参考までに1データのみ記載。
23
+ testList.add(new Test(1, 1, "tanaka", false));//データは複数あるが、参考までに1データのみ記載。
22
24
 
23
25
  ```
24
26
 
@@ -30,4 +32,86 @@
30
32
 
31
33
  ### 補足情報(FW/ツールのバージョンなど)
32
34
 
33
- Java8、Spring
35
+ Java8、Spring
36
+
37
+
38
+
39
+ Test.java
40
+
41
+ ```Java
42
+
43
+ package common.entities;
44
+
45
+
46
+
47
+ public class Test {
48
+
49
+
50
+
51
+ private int class;
52
+
53
+ private int no;
54
+
55
+ private String name;
56
+
57
+ private boolean flg;
58
+
59
+
60
+
61
+ public ParamClass(String substring, boolean b, int i) {
62
+
63
+ // TODO 自動生成されたコンストラクター・スタブ
64
+
65
+ }
66
+
67
+ public int getClass() {
68
+
69
+ return class;
70
+
71
+ }
72
+
73
+ public void setClass(int class) {
74
+
75
+ this.class = class;
76
+
77
+ }
78
+
79
+ public int getNo() {
80
+
81
+ return no;
82
+
83
+ }
84
+
85
+ public void setNo(int no) {
86
+
87
+ this.no = no;
88
+
89
+ }
90
+
91
+ public boolean getFlg() {
92
+
93
+ return flg;
94
+
95
+ }
96
+
97
+ public void setFlg(boolean flg) {
98
+
99
+ this.flg = flg;
100
+
101
+ }
102
+
103
+ public String getName() {
104
+
105
+ return name;
106
+
107
+ }
108
+
109
+ public void setName(String name) {
110
+
111
+ this.name = name;
112
+
113
+ }
114
+
115
+ }
116
+
117
+ ```