Predict the output constructors

 avatar
user_4300037950
java
2 years ago
453 B
173
Indexable
Never
public class Sample
{
    public Sample()
    {
        System.out.println("Default constructor");
    }
    public Sample(int i)
    {
        this();
        System.out.println("Single parameter constructor: " + i);
    }
    public Sample(int i, int j)
    {
        this(j);
        System.out.println("Double parameter constructor: " + i + ", " + j);
    }
    public static void main(String a[])
    {
        Sample ch = new Sample(0, 2);
    }
}