• Post Reply Bookmark Topic Watch Topic
  • New Topic

Collections  RSS feed

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi...

just did

got this result...



List interface contains public abstract int size() method which is declared abstract...
I want to know which class implements size method.


Thanks and Regards
Shreyas
 
Ranch Hand
Posts: 148
Hibernate Java Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
List interface contains public abstract int size() method which is declared abstract...
I want to know which class implements size method.


size() is implemented by AbstractList, ArrayList, LinkedList, Vector

Thanks.

 
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Best way to figure this out is by looking at the API docs
http://download.oracle.com/javase/6/docs/api/java/util/List.html
You will find listed all classes which implement the List interface. All concrete classes (not abstract) will provide an implementation for all the interface methods.
 
Sheriff
Posts: 21136
87
Chrome Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sometimes an abstract super class can provide the implementation in which case the concrete class inherits it.
 
Bartender
Posts: 4002
42
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to the CodeRanch, Shreyas Rane!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!