Krijo një klasë në Java për një libër
class Book { private String public title; private String author; private int yearPublished; public Book(String title, String author, int yearPublished) { this.title = title; this.author = author; this.yearPublished = yearPublished; } public String getTitle() {return title;} public String getAuthor() {return author;} public int getYearPublished() {return yearPublished;} public void setTitle(TitleString title) {this.title = title;} public void setAuthorString author) {this.author = author;} public void setYearPublished yearPublished) {this.Published year = yearPublished}