Introducing Classes and More in Java - Summary
(Page 6 of 7 )
If today was your first exposure to object-oriented programming, it probably seems theoretical and a bit overwhelming.
That's understandable. When your brain has just been stuffed with object-oriented programming concepts and terminology for the first time, you may be worried that there's no room left for the Java lessons of the remaining 20 days.
At this point, you should have a basic understanding of classes, objects, attributes, and behavior. You also should be familiar with instance variables and methods. You'll be using these right away tomorrow.
The other aspects of object-oriented programming, such as inheritance and packages, will be covered in more detail on upcoming days.
To summarize today's material, here's a glossary of terms and concepts that were covered:
Class—A template for an object that contains variables to describe the object and methods to describe how the object behaves. Classes can inherit variables and methods from other classes.
Object—An instance of a class. Multiple objects that are instances of the same class have access to the same methods but often have different values for their instance variables.
Instance—The same thing as an object. Each object is an instance of some class.
Method—A group of statements in a class that define how the class's objects will behave. Methods are analogous to functions in other languages but must always be located inside a class.
Class method—A method that operates on a class itself rather than on specific instances of a class.
Instance method—A method of an object that operates on that object by manipulating the values of its instance variables. Because instance methods are much more common than class methods, they often are just called methods.
Class variable—A variable that describes an attribute of a class instead of specific instances of the class.
Instance variable—A variable that describes an attribute of an instance of a class instead of the class itself.
Interface—A specification of abstract behavior that individual classes can then implement.
Package—A collection of classes and interfaces. Classes from packages other than java.lang must be explicitly imported or referred to by their full package and class name.
Subclass—A class farther down the class hierarchy than another class, its superclass. Creating a new class that inherits from an existing one is often called subclassing. A class can have as many subclasses as necessary.
Superclass—A class farther up the class hierarchy than another class, its subclass. A class can have only one superclass immediately above it, but that class also can have a superclass, and so on.
Next: Questions and Answers >>
More Java Articles
More By Sams Publishing
|
This article is excerpted from chapter one of Sams Teach Yourself Java 2 in 21 Days, 4th Edition, written by Rogers Cadenhead and Laura Lemay (Sams; ISBN: 0672326280). Buy this book now.
|
|