Hello i'm still kind of new to java.. I get the concept of "this" when it comes to instance variables but when i use it in a constructor with no parameters i get a little confused. So my question is how does something like this work?
private double x; private double y; public static final double EPSILON = 1e-5; public static boolean debug = false; public Point(double x, double y){ this.x=x; this.y=y; // Done sets the x,y private types to the x,y type provided in the () } public Point(){ this(0.0,0.0); //Sets, x and y to doubles of 0.0,0.0?? } //How does this work? Would my point() constructor create an origin of (0.0,0.0) by calling the point (x,y) constructor? Any clarification on this would help me out a lot!
this(...)allows you to chain constructor calls together to insure the state of the object when it is created