Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Collection Framework  RSS feed

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Arya Kumar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Arya Kumar wrote:


What is Collection Framework?
 
Arya Kumar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Collection Framework is an architecture used to manipulate data by using some standard rules.
It is the combination of:
Interfaces
Implementations
Algorithms
 
Arya Kumar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Why TreeSet does not containe disimilar objects?
 
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
TreeSet is an ordered set. Think about what that means - how do you define an order?
 
Ranch Hand
Posts: 432
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Arya Kumar wrote:
Why TreeSet does not containe disimilar objects?


TreeSet implements NavigableSet which extends SortedSet. So TreeSet is a sorted set. So all the objects that Treeset would contain must be of comparable type. i.e. They must implement comparable interface.
Would you ever be to compare an Interger with a String? No.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!