Have a look at the Campbell Ritchie Classification of Methods. The methods in the Arrays class do not take any information from anywhere in an Arrays objecy, nor do they send any information to anything in an Arrays object. So they can be static.
You can try creating an Arrays object to see whether you can get any information into or out of it, and you can't.
So what is the point of an Arrays object? So they have prevented you creating an Arrays object in the first place.
The classes java.util.Arrays and java.util.Collections are classes with utility methods for working with arrays and collections. It would not make much sense if they were not static, that would mean you have to create a dummy instance of those classes to be able to call the methods.
Yes that make sense that these to be static methods. Avoiding unnecessary object creation. Thanks for the quick replies. And Campbell's classification of methods is really a good guide on deciding a method to be static or non-static.
Joined: Oct 13, 2005
. . . but be careful about saying Campbell's anything is really good