[Solved] When we need Collections class method in Arraylist then why not Collections is extended? [closed]


Well may be because of the following reasons

  1. ArrayList already extends AbstractList and you can extends only one class in java
  2. All the functions of Collections are static
  3. They do not want anyone to override the methods in case in was not static
  4. If one argues that they can be converted into final non static methods then making Collections as the base class would be of no use.
  5. Methods in Collections are just a part of job which can be executed on ArrayList and it does not defines what ArrayList should do. Hence from an OOP point of view I, neither “The great man” would have done that.

solved When we need Collections class method in Arraylist then why not Collections is extended? [closed]