java - When we need Collections class method in Arraylist then why not Collections is extended? -


collections.sort() needed each , every time in arraylist when perform sorting , why not "the great man" has developed arraylist not added collections class extended class !

well may because of following reasons

  1. arraylist extends abstractlist , can extends 1 class in java
  2. all functions of collections static
  3. they not want override methods in case in not static
  4. if 1 argues can converted final non static methods making collections base class of no use.
  5. methods in collections part of job can executed on arraylist , not defines arraylist should do. hence oop point of view i, neither "the great man" have done that.

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -