• Post Reply Bookmark Topic Watch Topic
  • New Topic

methods and classes  RSS feed

 
bhuvan sundar
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have a query regarding methods and classes....

Which of the following is more efficient?
1) more methods in a class
2) more classes

Lets say that I've a class with 10 methods. I then split up those methods into 5 different classes. Which will have high performance?

Can someone help me in this?
 
Norm Radder
Rancher
Posts: 2240
28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why don't you write a test program, time the different tests and report back with the results!
Then we'd all know.
 
Steve Simon Joseph Fernandez
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

The question itself is irrelevant - classes and methods inside them are decided based on design principles and your requirements - and no matter which class you put your method in, it will have the same "performance".

_steve.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!