Criar um Site Grátis Fantástico

Total de visitas: 6109
Java Generics and Collections download
Java Generics and Collections download

Java Generics and Collections by Maurice Naftalin Maurice, Philip Wadler

Java Generics and Collections

Java Generics and Collections pdf download

Java Generics and Collections Maurice Naftalin Maurice, Philip Wadler ebook
Page: 288
Publisher: O'Reilly Media
Format: chm
ISBN: 0596527756, 9780596527754

Collections deal with objects which are java.lang.Object type. I was looking into one of my old Java source files and found out that I was struggling with correct syntax of Collection.sort() method using Generics when Java 1.5 was released. The most basic example for generics is a collection/data structure. Today at work a co-worker came up with an interesting question related to a warning related to unchecked types when using Collections.sort under Java 5. Generics are mostly used with Collections. The most popular usage of generics is undoubtedly the Java SE Collection utilities. So here I will attempt a brief description of what generics look like in Java and how to do some of the things you never knew you wanted to do. The common case for Java generics involves being able to write type-safe algorithms which can be applied to any appropriate data-type. When we save any object to Collections it saves as java.lang.Object type and it returns as such. That was the approach used by C# when generics were introduced, but Java did not take this approach because of the huge amount of pre-existing Java code using collections.

Other ebooks: