Monica. Shiralkar wrote:I have read that that too many static methods are not good for performance. Why should be avoid keeping to many static methods in code.

thanks..

Maybe what was meant was that if you have a large formula its not as efficient to break that formula's parts down into static methods as it is to just try and get it all done within one method. If you use several methods you'll have an extra cost of unnecessary references.

For static methods as opposed to instance methods, if anything it seems like static methods should be more efficient since they don't involve cost associated with the creation of an object.

Side question:
A program has 30 unused static methods and 1 used method, while another program only has the used method. Will the second program *run* faster than the first? My guess is no, the second program might compile some insignificant time faster, but its run time will be the same.

Monica. Shiralkar wrote:I have read that that too many static methods are not good for performance. Why should be avoid keeping to many static methods in code.

The second question is much more important than the first because - especially at this stage - the last thing that should be on your mind is performance.

Basically, static methods are restrictive because they can only access otherstatic methods and fields; and static fields - especially variables - are usually a BAD thing. Instance methods, OTOH, can access anything they can see.