Most classes have a constructor method. It's the method that gets called when the object is first created and can be used to set up its initial state:
public class Book {
//fields
private String title;
private String author;
private String publisher;
//constructor method
public Book(String bookTitle, String authorName, String publisherName)
{
//populate the fields
title = bookTitle;
author = authorName;
publisher = publisherName;
}
}
The constructor method uses the same name as the class (i.e., Book) and needs to be publicly accessible. It takes the values of the variables that are passed into it and sets the values of the class fields; thereby setting the object to it's initial state.

