Before you read this step-by-step guide you might want to cast your eye over introduction to object-oriented programing. The Java code contained in the following steps matches the example of a Book object used in the theory of that article.
By the end of this guide you will have learned how to:
- design an object
- store data in an object
- manipulate data in an object
- create a new instance of an object
The Class File
If you're new to objects you will most likely be used to created Java programs using only one file a Java main class file. It's the class that has the main method defined for the starting point of a Java program.
The class definition in the next step needs to be saved in a separate file. It follows the same naming guidelines as you have been using for the main class file (i.e., the name of the file must match the name of the class with the filename extension of .java). For example, as we are making a Book class the following class declaration should be saved in a file called "Book.java".

