View RSS Feed

Recent Blogs Posts

  1. Generic Set in Java

    by , 02-18-2012 at 03:45 PM
    It is also possible to generify the java.util.Set. Set instances in these cases might of a specific type.

    Instances of that type in such cases could be inserted or read, from that set.

    Usage of generic Set is explained here.
    Java Code: This is the code to explain usage of generic Set
    Set<String> set = new HashSet<String>;
    Adding Elements to a Generic Set

    To a set, specific String type is added by using this code.
    Java Code: This is the code to add specific String type in a Set
    Set<String> set = new HashSet<String>;
    ...
    Tags: generic set Add / Edit Tags
    Categories
    Generics