0 / 60 seg.

How does Java ensure the integrity of an object's state?

class Book {
    private int yearPublished;
    public void setYearPublished(int year) {
        if (year > 0) this.yearPublished = year;
    }
}