I have an issue where by my Vechicle Object is not having its date currently set to whatever today is. Strangely my test information Still comes out like this. All other functionality works fine with Calender.
Date Sold: Thu Jan 01 00:00:00 GMT 1970
Main Class
public void buyVechicle(String Vin){
Vechicle V = findVechicle(Vin);
if (V.getHasBeenSold() == true){
System.out.print("This car has already been sold");
}
else{
V.setHasBeenSold();
V.setDateSold();
}
}
Vechicle Class
public Calendar setDateSold(){
Calendar cal = Calendar.getInstance();
return cal;
}
You have to set/assign the value in your class.