Donate SIGN UP

Oo Programming (Java) - Abstract Class

Avatar Image
Tweed | 22:41 Wed 06th Mar 2013 | Technology
4 Answers
Posted in Science first but probably better here.

An abstract class cannot be instantiated. So, is the sole purpose of an abstract class to be a base class for an inherited class?
Gravatar

Answers

1 to 4 of 4rss feed

Best Answer

No best answer has yet been selected by Tweed. Once a best answer has been selected, it will be shown here.

For more on marking an answer as the "Best Answer", please visit our FAQ.
Yes, that way you can create a common interface for all the classes derived from the abstract base class.
Do you have a copy of "Thinking in Java by Bruce Eckel?
If not you can purchase it or download it from www.bruceeckel.com. However it costs, but the source code can be downloaded for free. The examples under polymorphism are useful for understanding abstract classes etc.
It doesn't have to be a base class of course. An abstract class can extend another abstract class (just to be confusing!)
Bruce Eckel's book is quite good but a lot of his examples, certainly when I read it, seem to me to be showing off and he had a habit of using meaningless names for his variables
The Oracle web site these days has some useful stuff on it.
Question Author
Many thanks for your answers folks.

1 to 4 of 4rss feed

Do you know the answer?

Oo Programming (Java) - Abstract Class

Answer Question >>