Maurice Naftalin's Java generics and collections PDF

By Maurice Naftalin

ISBN-10: 0596527756

ISBN-13: 9780596527754

This complete consultant exhibits you the way 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 burdened many builders whohaven't recognized tips to reap the benefits of those new features.

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

Topics lined include:

  • Fundamentals of generics: kind parameters and general methods
  • Other new positive factors: boxing and unboxing, foreach loops, varargs
  • Subtyping and wildcards
  • Evolution no longer revolution: primary 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 alternative collections

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

Philip Wadler is Professor of Theoretical computing device 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 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 such a lot lately served as an architect and mentor at NSB Retail platforms plc, and because the chief of the buyer improvement group of a big united kingdom executive social carrier system.

"A really good exposition of generics. by way of some distance the easiest e-book on thetopic, it offers a crystal transparent instructional that begins with thebasics and ends leaving the reader with a deep realizing of boththe use and layout of generics."
Gilad Bracha, Java Generics Lead, solar Microsystems

Show description

Read or Download Java generics and collections PDF

Similar object-oriented design books

Get Hibernate Quickly PDF

A concise creation to Hibernate's many configuration and layout suggestions, this publication distills Hibernate into digestible items with many code examples, sensible utilization eventualities, and insurance of the instruments to be had to builders writing Hibernate purposes. utilizing a move slowly, stroll, run educating technique, builders will study what Hibernate is, what it might probably do, and the way it may be used successfully.

David Robinson's Aspect-Oriented Programming with the e Verification Language PDF

What’s this AOP factor besides, really―when you get down to it―and can an individual please clarify what a side really is? Aspect-Oriented Programming with the e Verification Language takes a realistic, instance established, and enjoyable method of unraveling the mysteries of AOP. during this ebook, you’ll learn the way to:• Use AOP to prepare your code in a fashion that makes it effortless to house the stuff you quite care approximately on your verification environments.

Dragan Gaševic, Dragan Djuric, Vladan Devedžic, Bran V.'s Model Driven Architecture and Ontology Development PDF

Defining a proper area ontology is usually thought of an invaluable, to not say beneficial step in nearly each software program venture. reason why software program bargains with principles instead of with self-evident actual artefacts. even if, this improvement step is hardly performed, as ontologies depend on well-defined and semantically strong AI ideas comparable to description logics or rule-based platforms, and such a lot software program engineers are principally strange with those.

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

This textbook ordinarily addresses newbies and readers with a simple wisdom of object-oriented programming languages like Java or C#, yet with very little modeling or software program engineering adventure – hence reflecting the vast majority of scholars in introductory classes at universities. utilizing UML, it introduces easy modeling suggestions in a hugely unique demeanour, whereas refraining from the translation of infrequent unique situations.

Extra info for Java generics and collections

Sample text

If you can replace a type parameter with a wildcard then you should do so. We can improve the signature of max by replacing: > T max(Collection coll) with: > T max(Collection

Public boolean contains(E o); public boolean containsAll(Collection c); ... } Say we have a class MyList that implements MyCollection. containsAll(objs); // compile-time error The last two tests are illegal, because the type declarations require that we can only test whether a list contains an element of a subtype of that list. So we can check whether a list of objects contains a list of integers, but not the other way around. Which of the two styles is better is a matter of taste.

The test code builds three lists, one of apples, one of oranges, and one containing mixed fruits. We may find the maximum of the first two lists, but attempting to find the maximum of the mixed list signals an error at compile time. 1 permits comparison of apples with oranges. 1 are highlighted): Example 3-1. size ? size ? equals(o3); // ok } } Example 3-2. size ? size ? } As before, each fruit has a name and a size, and two fruits are equal if they have the same name and the same size. Now any two fruits are compared by ignoring their names and comparing their sizes.

Download PDF sample

Java generics and collections by Maurice Naftalin


by Jeff
4.5

Rated 4.56 of 5 – based on 37 votes