A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Programmer Certification (SCJP/OCPJP)
Constructor in Abstract Classes
Joined: Aug 11, 2008
Aug 11, 2008 09:05:00
My first post at Javaranch.
Wanted to know what purpose does constructors serve in Abstract Classes if those classes should never be instantiated.
Joined: Mar 07, 2008
Aug 11, 2008 10:50:00
Constructors in abstract classes get executed when their subclasses are instantiated. As you know there is has to be a call to super() in subclass' constructors.
SCJP - 93%
I agree. Here's the link:
subject: Constructor in Abstract Classes
The definition of instantiation for Abstract Superclass
Abstract class also has constructor
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015