Defining Classes in Java The syntax for declaring classes is quite rigid. In what appears below, anything contained inside angle brackets is information provided by you. Everything else is to be taken literally, with the exception of spaces, tabs, and newlines which can be used in any fashion. Any phrase starting with // is a comment and is not part of the class declaration. class { ; // this line can be repeated // any number of times. ( ) { } } EXAMPLE: public class Book { private int isbnNumber; public void loadIsbnNumber(int num) { isbnNumber = num; } public int getIsbnNumber() { return isbnNumber; } } USAGE: Book myBook; myBook = new Book(); myBook.loadIsbnNumber(12345); System.out.println(myBook.getIsbnNumber()); CREATE COMPLETE JAVA PROGRAM public class MySimpleProgram { public static void main(String args[]) // public static are modifiers // void is return type // main is the (required) // method name // args[] is a parameter { Book myBook; myBook = new Book(); myBook.loadIsbnNumber(12345); System.out.println(myBook.getIsbnNumber()); } }