*
The moose likes Beginning Java and the fly likes Tricky questions in collection? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Tricky questions in collection?" Watch "Tricky questions in collection?" New topic
Author

Tricky questions in collection?

santhosh.R gowda
Ranch Hand

Joined: Apr 06, 2009
Posts: 296
Dear all

Please tell me some tricky questions in collections so that i can test myself


Creativity is nothing but Breaking Rules
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

List at least three interfaces of the Java Collection Framework. (except the Collection interface)
One of the three interfaces must not extend the Collection interface.


[My Blog]
All roads lead to JavaRanch
santhosh.R gowda
Ranch Hand

Joined: Apr 06, 2009
Posts: 296
1. Observer
2. Enumeration
3. Iterator

Rahul P Kumar
Ranch Hand

Joined: Sep 26, 2009
Posts: 188
do they all belong to collection framework ? what does Observer interface does?
santhosh.R gowda
Ranch Hand

Joined: Apr 06, 2009
Posts: 296
Sorry now i thought that
1)Map
2)SortedMap
3)NavigableMap

Please let me know any others..?
Rahul P Kumar
Ranch Hand

Joined: Sep 26, 2009
Posts: 188
are the current list of interfaces linked somehow? Christophe, are listing subinterfaces counts in?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Rahul.p Kumar wrote:Christophe, are listing subinterfaces counts in?

Well yes. I would have been more satisfied with something like Map, List, Set, but I'm the one to blame for not being specific enough.
Rahul P Kumar
Ranch Hand

Joined: Sep 26, 2009
Posts: 188
Well then. Santosh, how you will create a map class which does neither accept null keys nor synchronized ?
 
 
subject: Tricky questions in collection?