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
- arraylist extends abstractlist , can extends 1 class in java
- all functions of collections static
- they not want override methods in case in not static
- if 1 argues can converted final non static methods making collections base class of no use.
- 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
Post a Comment