In my Java College Class, I have to create the class Customer. A customer has to have a first name, the last name, a birthday and an address.
The problem I have is to fill the default constructor since I have to assign a value to birthday
. But I don't know how to do it. If I try to write birthday = (1999,1,1)
it throws an error and asks me if I want to convert birthday to int
.
My code:
import java.util.Date;
public class Customer {
private String firstName, lastName;
private Date birthday;
private String address;
public Customer() {
firstName = "Hans";
lastName = "Meier";
//birthday = ?
address = "-";
}
public Customer(String firstName, String lastName, Date birthday, String address) {
this.firstName = firstName;
this.lastName = lastName;
this.birthday = birthday;
this.address = address;
}
public Customer(Customer customer) {
firstName = customer.firstName;
lastName = customer.lastName;
birthday = customer.birthday;
address = customer.address;
}
}