• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I want to create a class but the class no longer useful in other place

 
jacob deiter
Ranch Hand
Posts: 583
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to create a class but the class no longer useful in other place,

how I create class,please suggest

 
Stephan van Hulst
Bartender
Posts: 5334
48
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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: 583
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


here the class b is used only inside of class A, no where else it is used.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64613
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps you could define it as an inner class?
 
jacob deiter
Ranch Hand
Posts: 583
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please suggest what type of inner class best suited for this and using an inner class is a best practice?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64613
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic