Your preferences have been saved!
» Calling constructors with this - public class Flower {   int petalCount = 0;   String s = new String("null");   Flower(int petals) {     petalCount = petals;     System.out.println("Constructor w/ int arg only, petalCount= "         + petalCount);   }   Flower(String ss) {     System.out.println("Constructor w/ String arg only, s=" + ss);... 17 Feb 12 » This shows off the uses of this - // This shows off the uses of "this". It is a non-public class // just so the file name UseThis doesn't have to be the class name // (some students found "This" in the class name confusing in this example). public class MyClass {   final static int MAXX=640, MAXY=480;  // low-res (VGA)   int x, y;        // current location   /** Construct a MyClass with x and y values */   MyClass(int x, int y) {     this.x = x;     this.y = y;... 17 Feb 12 » Simple use of the this keyword - public class Leaf {   int i = 0;   Leaf increment() {     i++;     return this;   }   void print() {     System.out.println("i = " + i);   }   public static void main(String[] args) {... 17 Feb 12