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 Abstract class and private constructor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Abstract class and private constructor" Watch "Abstract class and private constructor" New topic
Author

Abstract class and private constructor

Sri Rajasekhar Jonnalagadda
Greenhorn

Joined: Nov 04, 2003
Posts: 2
Consider the following code
abstract class A {
private A() {}
}
How can a class which is supposed to be extended
have a constructor which is private.
dennis zined
Ranch Hand

Joined: Mar 07, 2003
Posts: 330
This will only work if the abstract class is nested.


SCJP 1.4<br />SCWCD 1.4
 
 
subject: Abstract class and private constructor
 
Similar Threads
Constructor in abstract class
final and abstract
abstract class
class Math is concrete class but still it cannot be instantiated.
Can constructors be declared private:If so whar are the advatages