Abstract classes are an interesting piece of Java. They can’t be used on their own, and they have a unique place in our code. They are often confused with interfaces, but they provide a great way to prevent code duplication and ensure consistent structures when building an application.
¬†In this tutorial we want to look at what Abstract classes are and when to use them. We will take a look at the previous Interfaces lesson and see how we could refactor our code from that lesson to use an Abstract class.
This lesson will cover some basic concepts in Java related to classes and objects. It was created as a lesson for a class room setting. I have converted it to a post here.
Class vs Object
Definition from page 10, Java A Beginner’s Guide (Herbert Schildt)
A class defines the form of an object. It specifies both the data and the code that will operate on that data. Java uses a class specification to construct objects. Objects are instances of a class. Thus, a class is essentially a set of plans that specify how to build an object.
The code and data that constitute a class are called members of the class. Specifically, the data defined by the class are referred to as member variables or instance variables. The code that operates on that data is referred to as member methods or just methods.
OO Trail: http://java.sun.com/docs/books/tutorial/java/javaOO/index.html