User Tools

Site Tools


java:inheritance

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
Previous revision
Next revision Both sides next revision
java:inheritance [2021/03/05 15:32]
gthanos [Κληρονομικότητα]
java:inheritance [2021/03/09 07:55]
gthanos
Line 15: Line 15:
   int height;   int height;
    
-  public Rectangle(int initWidth, int initHeight) {+  public BasicRectangle(int initWidth, int initHeight) {
     width = initWidth;     width = initWidth;
     height = initHeight;     height = initHeight;
Line 67: Line 67:
   void setY(int yPos) {   void setY(int yPos) {
     y = yPos;     y = yPos;
 +  }
 +  
 +  public String toString() {
 +    return "("+x+","+y+")";
   }   }
 } }
java/inheritance.txt · Last modified: 2022/03/11 05:21 by gthanos