我有一个要实例化的类,但是我不能,因为它给出了一个错误,该类是抽象类,而不是抽象类。
public class Comment {
@com.google.gson.annotations.SerializedName("postedBy")
private Map<String, String> postedBy = null;
@com.google.gson.annotations.SerializedName("content")
private String content = null;
@com.google.gson.annotations.SerializedName("location")
private String location = null;
public Map getPostedBy() {
return postedBy;
}
public void setPostedBy(Map postedBy) {
this.postedBy = postedBy;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
}
实例化
Comment c = new Comment();
它给出了错误
'Comment' is abstract; cannot be instantiated