File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Java in General
abstract class constructor
Joined: Aug 01, 2006
May 24, 2011 00:28:39
what is the use of abstract class constructor ? it seems legal but i don't see any use of it.
may i know more on this.
Joined: Feb 26, 2009
May 24, 2011 00:36:08
It would be useful to initialize any class variables in that abstract class , also it would be useful to initialize any private variables in that abstract class.
Joined: Oct 27, 2005
May 24, 2011 03:23:31
When a subclass instance is created, its constructor will first call the super class constructor - the constructor of the abstract class. And that's why you can create constructors for abstract classes, to initialize fields etc.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions
How To Answer Questions
I agree. Here's the link:
subject: abstract class constructor
Constructor in abstract class
Can i have a private constructor in an abstract class
private constructor in abstract classes
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013