|
3Java金币
public abstract class Demo{
private String colour = "orange";
private boolean filled;
private java.util.Date.dateCreated;
protected Demo(){
dateCreated = new java.util.Date();
}
protected Demo(String colour,boolean filled){
dateCreated = new java.util.Date();
this.colour = colour;
this.filled = filled;
}
//set get
public void setColour(String colour){
this.colour = colour;
}
public String getColour(){
return colour;
}
public void setFilled(boolean filled){
this.filled = filled;
}
public boolean isFilled(){
return filled;
}
public java.util.Date getDateCreated(){
return dateCreated;
}
@Override
public String toString(){
return "created on" + dateCreated + "\ncolour : " + colour + "and filled : "
+ filled;
}
public abstract double getArea();
public abstarct doublie getPerimeter();
}
注:红色字体就是不明白的地方,求学长们,老师们,帮忙解答下,实在是不明白
1.为什么能封装 java.util.Date.dateCreated 这是个什么东西?
2.为什么没写 getFilled而是inFilled ?
3. public java.util.Date getDateCreated(){
return dateCreated;
}
这句话是什么意思?看都看不懂。。
4. public abstract double getArea();
public abstarct doublie getPerimeter();
最后这两句放在 这个抽象类Demo里是什么啥意思??
|
|