aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes What to do ?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "What to do ??" Watch "What to do ??" New topic
Author

What to do ??

Kumar Navin
Ranch Hand

Joined: May 27, 2004
Posts: 52
Dear Friends,
I have to fulfill two conditions while defining the class-
1) I don't want my class to be extended.
2) I don't want anyone to instantiate my class.
How do I do that as a class cannot be abstract and final at the same time.
Thanks.

-Navin.
arnel nicolas
Ranch Hand

Joined: Dec 16, 2003
Posts: 149
How about making the constructor of your class private.
Beny Na
Ranch Hand

Joined: May 26, 2004
Posts: 159
hehe..yes..making the contructor as private as Arnel said.

good reply Nicholas..
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
and mark the class itself as final.


42
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What to do ??