Java - Constructors
What will be the output of the following code?
class Box {
int width, height;
Box() {
width = 10;
height = 10;
}
Box(int w, int h) {
width = w;
height = h;
}
void display() {
System.out.println(width + "," + height);
}
}
public class Test {
public static void main(String[] args) {
Box b1 = new Box();
Box b2 = new Box(5, 15);
b1.display();
b2.display();
}
}