aspose file tools
The moose likes Java in General and the fly likes abstract class constructor Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "abstract class constructor " Watch "abstract class constructor " New topic
Author

abstract class constructor

Rauhl Roy
Ranch Hand

Joined: Aug 01, 2006
Posts: 401

Hi,

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.

thanks,
roy.

Ravi Majety
Ranch Hand

Joined: Feb 26, 2009
Posts: 59

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.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

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
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: abstract class constructor
 
Similar Threads
abstract
Can i have a private constructor in an abstract class
abstract class
Constructor in abstract class
private constructor in abstract classes