wood burning stoves 2.0*
The moose likes Java in General and the fly likes How to make all collections(List,Map..etc..) type safe in java? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to make all collections(List,Map..etc..) type safe in java?" Watch "How to make all collections(List,Map..etc..) type safe in java?" New topic
Author

How to make all collections(List,Map..etc..) type safe in java?

alpesh helwatkar
Ranch Hand

Joined: Apr 06, 2009
Posts: 30

How to make all collections(List,Map..etc..) type safe in java?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

By using generics ? But I don't know exactly what you are asking for


[My Blog]
All roads lead to JavaRanch
Lalit Mehra
Ranch Hand

Joined: Jun 08, 2010
Posts: 384


as Sir Christopher said ... by using generics ... try using java 6.0 or above

generics will help you type safe what content you put into it .... but still make sure the polymorphism doesn't breaks your code ... use generics efficiently


http://plainoldjavaobject.blogspot.in
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Lalit Mehra wrote: try using java 6.0 or above

Generics are introduced in Java 1.5 itself
Lalit Mehra
Ranch Hand

Joined: Jun 08, 2010
Posts: 384

oops ... my mistake ...
alpesh helwatkar
Ranch Hand

Joined: Apr 06, 2009
Posts: 30

thanks a lot for the response.. observably i am a newbie to generics.. never had to use them in my previous project!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to make all collections(List,Map..etc..) type safe in java?
 
Similar Threads
Generics
Usage of wildcard?
Collections class ( Generics )
Collection Filtering
Collections in Khalid's book