This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
java:objects [2016/02/18 13:58] doufexi fixed constructor and calls, added observation re: field initialization in constructor, added toc link, fixed minor typos |
java:objects [2016/02/19 13:01] doufexi |
||
---|---|---|---|
Line 41: | Line 41: | ||
private Point origin; | private Point origin; | ||
| | ||
- | // the Rectangle class has one constructor | + | // the Rectangle class has two constructors |
public Rectangle(int initWidth, int initHeight, Point initOrigin) { | public Rectangle(int initWidth, int initHeight, Point initOrigin) { | ||
width = initWidth; | width = initWidth; |