Getters and setters
In the world of Java development, it is very common to hear about get and set, or getters and setters, which are methods that allow us to assign a value or obtain a value. The values refer to the properties of an object, so Set allows us to assign a value to the property of the object, and Get lets us know the value of the property of a certain object.
Get will always give us a value which means it will return a value, and we can already intuit that it will work like a return from a function. We will continue using the example of the Book class, and in Java, there is some simple and fast code to enter the get and set methods of a property:
public class Book {
    private String title;
    private String author;
    private String isbn;
    private int pages;
    public Book(String title, String author, String isbn, int pages) {
        this.title = title;
        this.author = author;
        this.isbn = isbn;
        this.pages = pages;
    }
    // Getter...