これは、顧客クラスの属性です。
public class Customer {
private String customer_username;
private String customer_password;
private String name;
private String surname;
private Date dateOfBirth;
private String address;
private String postcode;
private String email;
(...)
これは、txt ファイルに保存するメソッドです。Date dateOfBirth のエラーがあります。機能させるために何を含めればよいかわかりません。
public void saveToFile(){
FileWriter out = null;
try{
out = new FileWriter("CustomerDetails.txt", true);
out.append("Customer Username: ");
out.append(customer_username);
out.append(System.getProperty("line.separator"));
out.append("Customer Password: ");
out.append(customer_password);
out.append(System.getProperty("line.separator"));
out.append("Name: ");
out.append(name);
out.append(System.getProperty("line.separator"));
out.append("Surname: ");
out.append(surname);
out.append(System.getProperty("line.separator"));
**out.append("Date of Birth: ");**
**out.append(dateOfBirth);**
out.append(System.getProperty("line.separator"));
out.append("Address: ");
out.append(address);
out.append(System.getProperty("line.separator"));
out.append("Postcode: ");
out.append(postcode);
out.append(System.getProperty("line.separator"));
out.append("Email: ");
out.append(email);
out.append(System.getProperty("line.separator"));
out.append(System.getProperty("line.separator"));
out.append("**********************************");
out.append(System.getProperty("line.separator"));
out.append(System.getProperty("line.separator"));
out.close();
}catch (IOException ioe){
}