View RSS Feed

Advanced Java

Advanced Java programming.

  1. Dynamic Type Safety in Pre Java 5 Code Collections

    by , 11-29-2011 at 10:40 PM
    Sometimes is might be necessary to pass generic containers to pre-Java5 code. In those cases, it is possible that the old-style code can corrupt your containers. In order to address this issue, there are a set of utilities in the java.util.Collections package to address the issues around type-checking. There are a number of static methods designed for this. They all take the container that you are checking as the first argument and the type you want to enforce as the second argument. They are shown ...