This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes abstract class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "abstract class" Watch "abstract class" New topic
Author

abstract class

Amol Dongre
Greenhorn

Joined: Sep 17, 2010
Posts: 11
why abstract class allow private constructor when abstract class can not be instantiated and private constructor can not be called through super() in subclasses
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 44576
    
  34
Amol Dongre
Greenhorn

Joined: Sep 17, 2010
Posts: 11
Campbell Ritchie wrote:


not clear can you explain it briefly
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 44576
    
  34
You can call the private constructor from the public constructor. Another version of the same thingIt is possible to use a private constructor from within the class. In an abstract class, that is probably only useful if called from a non-private constructor. Agreed, it is not something you will want at all frequently.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: abstract class
 
It's not a secret anymore!