Sobes.tech
Intern — Middle

Determining the car with the latest manufacturing date

livecode

Task condition

The Car class stores the release date in the creationDate field of type LocalDate. Create three Car objects with different release dates, put them in a list, and find the element with the latest release date.

public class Car {
    private LocalDate creationDate;

    public Car(LocalDate creationDate) {
        this.creationDate = creationDate;
    }

    public LocalDate getCreationDate() {
        return creationDate;
    }

    public void setCreationDate(LocalDate creationDate) {
        this.creationDate = creationDate;
    }
}