I am making an object class inherited from my base class. I am trying to make my default non argument constructor using this(), and it keeps highlighting red when I try to make a default Date object cuz of my Date instance variable.
PS (I already tried instantiating inside the new Date() brackets with the instance variables in Date class) Any ideas why or how to fix?
public class Employee extends Person
{
private Date hireDate;
public Employee()
{
this("No name", new Date() ); //THIS IS RED
}
}
super(...)instead ofthis(...)? Constructors aren't inherited.//THIS IS REDaside marking part of code as red, editor also generates text with information about reason behind it. Try to look for it.