Considering encapsulation in Java, what is the purpose of making a class attribute private and providing public getters and setters?
class Book {
private String title;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
}