File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Can an abstract class contain a constuctor? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Can an abstract class contain a constuctor?" Watch "Can an abstract class contain a constuctor?" New topic
Author

Can an abstract class contain a constuctor?

Tan Richards
Greenhorn

Joined: Sep 29, 2005
Posts: 18
Hi,
I'm new to Java and in the procees of learning.Can u plz answer the question for me with some explanation if possible?


"Failures are pillars of success" - That doesn't mean you go on building pillars
A Kumar
Ranch Hand

Joined: Jul 04, 2004
Posts: 979
Hi,

Yes you can have constructors in abstract class..
but you cant instantiate the abstract class....

Ex: AbstractClassA ab=new AbstractClassA();

where AbstractClassA is an abstract class.



But you cant have constructor in interface..

hope you got it...
[ September 29, 2005: Message edited by: A Kumar ]
Tan Richards
Greenhorn

Joined: Sep 29, 2005
Posts: 18
Yeah, thank you
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can an abstract class contain a constuctor?