How can I print date using constructor chaining in java ? I am getting error after this(6,2018) stating I need two argument constructor why is that? And when i use the quick fix a new constructor Date(int i, int j) is created. I am unable to understand this too. Here's what I tried -:
public class Date
{
int dd;
public Date()
{
this(30);
}
public Date(int dd)
{
this(6,2018);
this.dd=dd;
}
public static void main(String arg[])
{
Date ob= new Date();
}
}