April 2019
Intermediate to advanced
360 pages
9h 17m
English
The Book class establishes the class structure with three class variables: isbn, title, and year. Accessor and mutator (getters and setters) methods are provided for each of the class variables:
public class Book { private String isbn; private String title; private int year; // accessor methods public String getISBN() { return isbn; } public String getTitle() { return title; } public int getYear() { return year; } // mutator methods public void setISBN(String isbn) { this.isbn = isbn; } public void setTitle(String title) { this.title = title; } public void setYear(int year) { this.year = year; }}
The Book class defined previously represents the model component of our MVC architectural pattern.
Read now
Unlock full access