Java generics and collections by Maurice Naftalin PDF

By Maurice Naftalin

ISBN-10: 0596527756

ISBN-13: 9780596527754

This finished advisor indicates you the way to grasp the main importantchanges to Java because it used to be first published. Generics and the greatlyexpanded assortment libraries have significantly elevated the ability ofJava five and Java 6. yet they've got additionally pressured many builders whohaven't identified find out how to make the most of those new features.

Java Generics and Collections covers every thing from the mostbasic makes use of of generics to the strangest nook circumstances. It teaches youeverything you want to find out about the collections libraries, so you'llalways recognize which assortment is acceptable for any given activity, andhow to take advantage of it.

Topics lined include:

  • Fundamentals of generics: kind parameters and everyday methods
  • Other new positive aspects: boxing and unboxing, foreach loops, varargs
  • Subtyping and wildcards
  • Evolution now not revolution: favourite libraries with legacy consumers andgeneric consumers with legacy libraries
  • Generics and reflection
  • Design styles for generics
  • Sets, Queues, Lists, Maps, and their implementations
  • Concurrent programming and thread security with collections
  • Performance implications of alternative collections

Generics and the hot assortment libraries they encouraged take Java to anew point. that allows you to take your software program improvement perform toa new point, this ebook is key reading.

Philip Wadler is Professor of Theoretical desktop technological know-how at theUniversity of Edinburgh, the place his study makes a speciality of the layout ofprogramming languages. he's a co-designer of GJ, paintings thatbecame the root for generics in Sun's Java 5.0.

Maurice Naftalin is Technical Director at Morningside mild Ltd., a software program consultancy within the uk. He has so much lately served as an architect and mentor at NSB Retail platforms plc, and because the chief of the customer improvement workforce of a tremendous united kingdom executive social carrier system.

"A tremendous exposition of generics. by way of a long way the easiest ebook on thetopic, it offers a crystal transparent educational that begins with thebasics and ends leaving the reader with a deep figuring out of boththe use and layout of generics."
Gilad Bracha, Java Generics Lead, solar Microsystems

Show description

Read or Download Java generics and collections PDF

Best object-oriented design books

Read e-book online Java Enterprise in a Nutshell: A Desktop Quick Reference (In PDF

Caution to all purchasers, the third version of this e-book doesn't comprise the J2EE library reference. whereas I detect this data is obtainable on-line, having a broadcast type of library references is the first cause i purchase the "in a nutshell" sequence. incorporated during this booklet is a truly normal evaluate of varied company applied sciences, which not like the very precious language reference contain in different "in a nutshell" books, turns out too wide and shallow to be valuable.

Java generics and collections by Maurice Naftalin PDF

This entire advisor exhibits you ways to grasp the main importantchanges to Java because it used to be first published. Generics and the greatlyexpanded assortment libraries have greatly elevated the facility ofJava five and Java 6. yet they've got additionally careworn many builders whohaven't identified tips on how to benefit from those new beneficial properties.

Download PDF by Martin Kalin: Java Web Services: Up and Running: A quick, practical, and

This example-driven e-book bargains an intensive creation to Java's APIs for XML internet providers (JAX-WS) and RESTful net prone (JAX-RS). Java internet companies: Up and operating takes a transparent, pragmatic method of those applied sciences by way of offering a mixture of architectural evaluation, whole operating code examples, and brief but designated directions for compiling, deploying, and executing an program.

Download e-book for kindle: Resource-Oriented Computing with NetKernel: Taking REST by Tom Geudens

Take resource-oriented computing out for a spin with this hands-on advent to NetKernel, and observe how ROC can enhance how you layout and enforce software program and software program structures. learn the way ROC's new procedure combines middle principles from the remainder architectural sort with the Unix improvement version.

Extra info for Java generics and collections

Sample text

Htm 4/13/2007 Part I: Generics Page 26 of 138 Here we say that the type variable T has captured the wildcard. This is a generally useful technique when dealing with wildcards, and it is worth knowing. Another reason to know about wildcard capture is that it can show up in error messages, even if you don't use the above technique. In general, each occurrence of a wildcard is taken to stand for some unknown type. If the compiler prints an error message containing this type, it is referred to as capture of ?.

The second compares an integer with an arbitrary object: it casts the object to an integer and calls the first method. The second method is necessary in order to override the compareTo method in the Comparable interface, because overriding occurs only when the method signatures are identical. This second method is called a bridge. Example 3-6. value) ? value) ? 7 shows what happens when the Comparable interface and the Integer class are generified. In the generic interface, the compareTo method takes an argument of type T.

But don't panic. Actually, we've already seen something similar. 2), and we'll see that they appear for related reasons. To understand what's going on, we need to take a look at the code. 5 shows the class Season that corresponds to the enumerated type declaration above. ) Example 3-4. ordinal; } } Example 3-5. equals(name)) return e; throw new IllegalArgumentException(); } } Here is the first line of the declaration for the Enum class: public abstract class Enum> implements Comparable And here is the first line of the declaration for the Season class: class Season extends Enum Matching things up, we can begin to see how this works.

Download PDF sample

Java generics and collections by Maurice Naftalin

by James

Rated 4.19 of 5 – based on 28 votes

Related posts