Java - Constructors
What will be the output of this code snippet?
class Point {
int x, y;
Point() { x = 0; y = 0; }
Point(int x, int y) { this.x = x; this.y = y; }
void display() { System.out.println(x + "," + y); }
}
public class Test {
public static void main(String[] args) {
Point p1 = new Point();
Point p2 = new Point(3, 4);
p1.display();
p2.display();
}
}