Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJP
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Programmer Certification (OCPJP)
What to do ??
Kumar Navin
Ranch Hand
Posts: 52
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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
Posts: 149
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
How about making the constructor of your class private.
Beny Na
Ranch Hand
Posts: 159
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
hehe..yes..making the contructor as private as Arnel said.
good reply Nicholas..
Jeroen Wenting
Ranch Hand
Posts: 5093
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
and mark the class itself as final.
42
I will open the floodgates of his own worst nightmare! All in a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
don't create too much object?
ApplicationResources
modify method in byte code using ASM.
Don't want to use ActionForm only Action class
Input Display
More...