Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Beginning Java
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:
Beginning Java
I want to create a class but the class no longer useful in other place
jacob deiter
Ranch Hand
Posts: 594
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I want to create a class but the class no longer useful in other place,
how I create class,please suggest
Stephan van Hulst
Saloon Keeper
Posts: 15484
363
posted 13 years ago
2
Number of slices to send:
Optional 'thank-you' note:
Send
What do you mean, the class is no longer useful in other places?
Please give more details about what you're trying to do.
jacob deiter
Ranch Hand
Posts: 594
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Class A { B b =new B(); }
here the class b is used only inside of class A, no where else it is used.
Bear Bibeault
Sheriff
Posts: 67746
173
I like...
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Perhaps you could define it as an inner class?
[
Asking smart questions
] [
About Bear
] [
Books by Bear
]
jacob deiter
Ranch Hand
Posts: 594
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
please suggest what type of inner class best suited for this and using an inner class is a best practice?
Bear Bibeault
Sheriff
Posts: 67746
173
I like...
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I use inner classes only when the class only makes sense within the context of the parent class. I think it
is
something that is overused in general and your caution is warranted.
[
Asking smart questions
] [
About Bear
] [
Books by Bear
]
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Defining classes runtime
how to add LOG function in richfaces
paintComponent() Method?
JAR tool
CodeGenerator code refactoring
More...