I was going through java doc and I learned that methods in Arrays class in java are all static . I don't really understand the reason behind why they made it static.
For example the following code violates the OO Approach, because if i have a type 'X' , then all the methods which acts on it should be inside it
In Java there is no way to extend the functionally of an array. Arrays all inherit from
Object but this gives very little. IMHO This is a deficiency of Java.
Instead, to add functionality for arrays, static utility methods are added to classes like
Arrays. These methods are
static as they are not instance methods.