August 2004
Intermediate to advanced
480 pages
9h 41m
English
A class typically represents a type of thing in the world of the application. You define a class, and in it write code that represents two things: the properties of that type of thing and how it behaves. You might think of classes as categories. For instance, Person is a category or type of thing in the world. To make a class, you simply open your editor, type the keywords public class, and give it a name. Save that file with a .java extension and compile it using the javac command that comes with the SDK.
We can make a class called Person like this:
public class Person { }
If you type the preceding code into a text file called Person.java, it will compile. However, it is obviously useless, because it doesn't hold any data, ...
Read now
Unlock full access