Soldato
- Joined
- 5 Dec 2003
- Posts
- 2,716
- Location
- Glasgow
Em as title really... i'm trying to run this constrctor object so that a date is passed to it from another object eventually and then it can store the date information in the appropriate format but I can't seem to get it to work, here is the code:
public class Customer
{
// instance variables
private String name;
private String address;
private Date dateOfBirth;
/**
* Constructor for objects of class Customer
*/
public Customer(String customerName, String customerAddress, Date customerDateOfBirth)
{
// add new customer
SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
Date dateOfBirth = new Date();
name = customerName;
address = customerAddress;
dateOfBirth = customerDateOfBirth();
}
public class Customer
{
// instance variables
private String name;
private String address;
private Date dateOfBirth;
/**
* Constructor for objects of class Customer
*/
public Customer(String customerName, String customerAddress, Date customerDateOfBirth)
{
// add new customer
SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
Date dateOfBirth = new Date();
name = customerName;
address = customerAddress;
dateOfBirth = customerDateOfBirth();
}