Prev Next

Java / Generics

Unbounded Wildcards.

Also known as Collection of Unknown type, specified using the wildcard character(?). for e.g., List , Collection.

An example of unbounded wildcards.

public static void printCollection(List<?> myList) {
    for (Object key: myList) {
        System.out.print(key + " ");
               }             
}


More Related questions...

Show more question and Answers...


Comments & Discussions