New PDF release: Java generics and collections

By Maurice Naftalin

ISBN-10: 0596527756

ISBN-13: 9780596527754

This entire consultant indicates you the way to grasp the main importantchanges to Java because it was once first published. Generics and the greatlyexpanded assortment libraries have greatly elevated the ability ofJava five and Java 6. yet they've got additionally careworn many builders whohaven't recognized the best way to benefit from those new features.

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

Topics lined include:

  • Fundamentals of generics: sort parameters and widespread methods
  • Other new gains: boxing and unboxing, foreach loops, varargs
  • Subtyping and wildcards
  • Evolution no longer revolution: popular 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 protection with collections
  • Performance implications of other collections

Generics and the recent assortment libraries they encouraged take Java to anew point. in order to take your software program improvement perform toa new point, this publication is key reading.

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

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

"A tremendous exposition of generics. by means of a ways the simplest ebook on thetopic, it offers a crystal transparent instructional 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

Download e-book for iPad: Aspect-Oriented Programming with the E Verification by David Robinson

This ebook describes a realistic method of element orientated Programming utilizing e. it is approximately utilizing AOP in ways in which will make readers' code more uncomplicated to write down, more uncomplicated to take advantage of, more uncomplicated to reuse, and in a manner that is helping to satisfy venture schedules. It offers genuine examples of AOP in motion, and comprises guidance on the best way to set up code in order that you possibly can locate very important issues back.

Read e-book online Object Oriented Reengineering Patterns (The Morgan Kaufmann PDF

The documentation is lacking or out of date, and the unique builders have departed. Your group has restricted realizing of the procedure, and unit checks are lacking for lots of, if no longer all, of the parts. if you happen to repair a trojan horse in a single position, one other computer virus pops up elsewhere within the procedure. lengthy rebuild occasions make any swap tough.

Maurice Naftalin's Java generics and collections PDF

This entire consultant indicates you ways to grasp the main importantchanges to Java because it used to be first published. Generics and the greatlyexpanded assortment libraries have drastically elevated the facility ofJava five and Java 6. yet they've got additionally burdened many builders whohaven't identified easy methods to make the most of those new beneficial properties.

Download PDF by Martina Seidl, Marion Scholz, Christian Huemer, Gerti Kappel: UML @ Classroom: An Introduction to Object-Oriented Modeling

This textbook in general addresses novices and readers with a easy wisdom of object-oriented programming languages like Java or C#, yet with very little modeling or software program engineering event – hence reflecting nearly all of scholars in introductory classes at universities. utilizing UML, it introduces easy modeling innovations in a hugely unique demeanour, whereas refraining from the translation of infrequent certain instances.

Additional info for Java generics and collections

Sample text

Stands for: Collection Extending Object is one of the most common uses of wildcards, so it makes sense to provide a short form for writing it. containsAll(objs); The given list of objects contains both the string "one" and the given list of integers, but the given list of integers does not contain the string "one", nor does it contain the given list of objects. containsAll(objs) might seem silly. Of course, a list of integers won't contain an arbitrary object, such as the string "one".

Now any two fruits are compared by ignoring their names and comparing their sizes. Since Fruit implements Comparable, any two fruits may be compared. Now the test code can find the maximum of all three lists, including the one that mixes apples with oranges. Recall that at the end of the previous section we extended the type signature of compareTo to use super: > T max(Collection coll) The second example shows why this wildcard is needed. If we want to compare two oranges, we take T in the preceding code to be Orange: Orange extends Comparable

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. The type variable E stands for the subclass of Enum that implements a particular enumerated type, such as Season.

Download PDF sample

Java generics and collections by Maurice Naftalin


by Paul
4.0

Rated 4.12 of 5 – based on 16 votes

Categories: Object Oriented Design