弱弱的问一句。this 怎么用啊
java吧
全部回复
仅看楼主
level 5
cuijiaji1993 楼主
如题。新手跪求指导
2012年05月02日 14点05分 1
level 5
cuijiaji1993 楼主
public class GeometricObject {
private String color = "white";
private boolean filled;
private java.util.Date dateCreated; public GeometricObject() {
dateCreated = new java.util.Date();
} public GeometricObject(String color, boolean filled) {
dateCreated = new java.util.Date();
this.color = color;
this.filled = filled;
} public String getColor() {
return color;
} public void setColor(String color) {
this.color = color;
} public boolean isFilled() {
return filled;
} public void setFilled(boolean filled) {
this.filled = filled;
} public java.util.Date getDateCreated() {
return dateCreated;
} public String toString() {
return "created on " + dateCreated + "\ncolor: " + color
+ " and filled: " + filled;
}
}
这段求解释啊大哥们
2012年05月02日 15点05分 6
level 5
cuijiaji1993 楼主
诶呀我草。懂了。谢谢各位大哥们。尤其是 不吃猫儿的鱼
2012年05月02日 15点05分 7
level 5
cuijiaji1993 楼主
诶呀我草。懂了。谢谢各位大哥们。尤其是 不吃猫儿的鱼
2012年05月02日 15点05分 8
1