質問編集履歴
1
Baseクラスのフィールドのstaticを除去 BaseインスタンスのBase.~をthis.~へ変更
title
CHANGED
File without changes
|
body
CHANGED
@@ -9,14 +9,14 @@
|
|
9
9
|
import java.util.Calendar;
|
10
10
|
|
11
11
|
public abstract class Base {
|
12
|
-
public
|
12
|
+
public int tweetId = 0;
|
13
|
-
public
|
13
|
+
public long datetime = 0;
|
14
|
-
public
|
14
|
+
public String userId = "";
|
15
15
|
|
16
16
|
public Base(int tweetId,String userId) {
|
17
|
-
|
17
|
+
this.tweetId = tweetId;
|
18
|
-
|
18
|
+
this.userId = userId;
|
19
|
-
|
19
|
+
this.datetime = getNow();
|
20
20
|
}
|
21
21
|
public static long getNow(){
|
22
22
|
Calendar cl = Calendar.getInstance();
|
@@ -24,7 +24,7 @@
|
|
24
24
|
return Long.parseLong(sdf.format(cl.getTime()));
|
25
25
|
}
|
26
26
|
public int getTweetId() {
|
27
|
-
return
|
27
|
+
return tweetId;
|
28
28
|
}
|
29
29
|
public abstract String getText();
|
30
30
|
|
@@ -42,7 +42,7 @@
|
|
42
42
|
}
|
43
43
|
|
44
44
|
public class Reply extends Tweet{
|
45
|
-
private String target =
|
45
|
+
private String target = super.userId;
|
46
46
|
public Reply(int tweetId,String userId,String text, Tweet target) {
|
47
47
|
super(tweetId,userId,text);
|
48
48
|
}
|