java:objects

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
java:objects [2016/02/19 13:01]
doufexi
java:objects [2016/02/19 13:02]
doufexi
Line 36: Line 36:
 public class Rectangle { public class Rectangle {
     ​     ​
-  // the Rectangle class has 3 fields+  // fields
   private int width;   private int width;
   private int height;   private int height;
   private Point origin;   private Point origin;
     ​     ​
-  // the Rectangle class has two constructors+  // constructors
   public Rectangle(int initWidth, int initHeight, Point initOrigin) {   public Rectangle(int initWidth, int initHeight, Point initOrigin) {
     width = initWidth;     width = initWidth;
Line 54: Line 54:
   }   }
     ​     ​
-  // the Rectangle class has 3 methods+  // methods
   public void setWidth(int newWidth ) {   public void setWidth(int newWidth ) {
     width = newWidth;     width = newWidth;
java/objects.txt · Last modified: 2018/02/16 16:03 by gthanos