A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
EJB 3 in Action
this week in the
EJB and other Java EE Technologies
Programmer Certification (SCJP/OCPJP)
What to do ??
Joined: May 27, 2004
Jun 22, 2004 23:54:00
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.
Joined: Dec 16, 2003
Jun 23, 2004 00:00:00
How about making the constructor of your class private.
Joined: May 26, 2004
Jun 23, 2004 03:25:00
hehe..yes..making the contructor as private as Arnel said.
good reply Nicholas..
Joined: Oct 12, 2000
Jun 23, 2004 04:09:00
and mark the class itself as final.
I agree. Here's the link:
subject: What to do ??
don't create too much object?
Don't want to use ActionForm only Action class
modify method in byte code using ASM.
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014