This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

difference betwen Collection and Collections

 
michel razz
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm confusing from last fewdays onwards
what is the main defference between Collection and Collections
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A collection is the super interface of Maps and Sets.

Collections is a utility class that provides functionality such as sorting etc.
 
Ankit Garg
Sheriff
Posts: 9510
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The best place would be to look at the documentation of both

java.util.Collections
java.util.Collection
 
Balraj Momi
Ranch Hand
Posts: 45
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A collection is the super interface of Maps and Sets.


Collection is not super type for Maps, It is only for Lists, Sets and family.

Regards Balraj
 
Lucas Smith
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sometimes you have to keep your eyes opened to spot the letter "s".
 
Lucas Smith
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Balraj Momi wrote:
A collection is the super interface of Maps and Sets.


Collection is not super type for Maps, It is only for Lists, Sets and family.

Regards Balraj

Exactly
So, for example you can not invoke add(...) method on a Map object. BE AWARE!
 
happy -nag
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A Collection is an interface which can be used
for representing a group of objects as Single Entity
But
Collections is an Utility class defined several Utility methods
for Collection Objects..
 
Lucas Smith
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adam -eve - give your full name.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic