Generics

TwitterFacebook
Get flash to fully experience Pearltrees
http://www.artima.com/forums/flat.jsp?forum=106&thread=132988 Error Occurred Sadly, the thread you requested does not exist at the Artima Forums. Artima.com occasionally deletes threads that are off-topic or offensive (we know it when we see it), but not always before they are indexed by search engines.

Mixins: Something Else You Can't Do With Java Generics?

J2SE 1.5 will become available by mid of 2004 and will include support for generic types and methods (see / JDK15 /). This new language feature, known as Java Generics (JG), is a major addition to the core language. In this article we will give an overview of the new feature. The need for generic types stems from the implementation and use of collections, like the ones in the Java collection framework (see / JDK15 /).

AngelikaLanger.com - Java Generics - Introduction - Angelika Langer Training/Consulting

http://www.angelikalanger.com/Articles/JavaPro/01.JavaGenericsIntroduction/JavaGenerics.html

Java Generics FAQs - Frequently Asked Questions - Angelika Langer Training/Consulting

All text and content found at URLs starting with http://www.AngelikaLanger.com/GenericsFAQ/ (collectively, "the Java Generics FAQ") are the sole property of Angelika Langer. Copyright @ 2004-2012 by Angelika Langer . All rights reserved. Except as specifically granted below, you may not modify, copy, publish, sell, display, transmit (in any form, or by any means, electronic, mechanical, photocopying, recording, or otherwise), adapt, distribute, store in a retrieval system, create derivative works, or in any other way use or exploit the contents of the Java Generics FAQ, without the prior consent of the author. http://www.angelikalanger.com/GenericsFAQ/JavaGenericsFAQ.html
The term "unchecked" warning is misleading. It does not mean that the warning is unchecked in any way. The term "unchecked" refers to the fact that the compiler and the runtime system do not have enough type information to perform all type checks that would be necessary to ensure type safety. In this sense, certain operations are "unchecked". The most common source of "unchecked" warnings is the use of raw types. "unchecked" warnings are issued when an object is accessed through a raw type variable, because the raw type does not provide enough type information to perform all necessary type checks. http://www.angelikalanger.com/GenericsFAQ/FAQSections/TechnicalDetails.html

Java Generics FAQs - Under The Hood Of The Compiler - Angelika Langer Training/Consulting

AngelikaLanger.com - Java Generics - Wilcard Instantiations of Parameterized Types - Angelika Langer Training/Consulting

http://www.angelikalanger.com/Articles/JavaPro/02.JavaGenericsWildcards/Wildcards.html With the release of J2SE 1.5 (announced for August 2004) parameterized types and methods, also known as Java Generics, will be available as a new language feature of the Java programming language. We gave an overview of most of the Java Generics features in a previous article (see / PRO1 /). This time we aim to explain wildcards ?
Many people are unsatisfied with the restrictions caused by the way generics are implemented in Java. Specifically, they are unhappy that generic type parameters are not reified : they are not available at runtime. Generics are implemented using erasure , in which generic type parameters are simply removed at runtime. That doesn't render generics useless, because you get typechecking at compile-time based on the generic type parameters, and also because the compiler inserts casts in the code (so that you don't have to) based on the type parameters. Generics are implemented using erasure as a response to the design requirement that they support migration compatibility : it should be possible to add generic type parameters to existing classes without breaking source or binary compatibility with existing clients. I wrote about this two years ago.

Reified Generics for Java

http://gafter.blogspot.com/2006/11/reified-generics-for-java.html
It's traditional for new columnists to spend a paragraph or two introducing themselves, establishing their bona-fides, and talking about the overall goal of the column. In that spirit, I'll mention that I've been programming in Java for seven years now, I've written a book ( Java RMI ), co-authored another ( Java Enterprise Best Practices ), and written scads of individual articles (for O'Reilly's online magazine, ONJava , among other places). In short, even though this is my first column for java.net, I feel like a old hand at this (when Daniel Steinberg asked me if I'd write a monthly column, I thought it was a natural thing to do -- the only place we really quibbled was over the column name. I'm sorry, but "Deep Geeking" just isn't a column I want to write). As to the goal of the column, well, I'm going to spend the next year or so shining a flashlight into some fairly obscure and dusty corners of the Java universe. http://today.java.net/pub/a/today/2003/12/02/explorations.html

Explorations: Generics, Erasure, and Bridging

http://onjava.com/pub/a/onjava/excerpt/javaian5_chap04/index.html O'Reilly Book Excerpts: Java in a Nutshell, 5th Edition by David Flanagan

Generic Types, Part 1

Generic Types, Part 2

O'Reilly Book Excerpts: Java in a Nutshell, 5th Edition by David Flanagan Editor's note: In part one of this two-part excerpt from Java in a Nutshell, 5th Edition , David Flanagan described how to use generic types. http://onjava.com/pub/a/onjava/excerpt/javaian5_chap04/index1.html
Here is another example of a generics method that uses wildcards to sort a list into ascending order.

Using and Programming Generics in J2SE 5.0

Generic types (or generics) bear a superficial resemblance to templates in C++, both in their syntax and in their expected use cases (such as container classes). But the similarity is only skin-deep -- generics in the Java language are implemented almost entirely in the compiler, which performs type checking and type inference, and then generates ordinary, non-generic bytecodes. This implementation technique, called erasure (where the compiler uses the generic type information to ensure type safety, but then erases it before generating the bytecode), has some surprising, and sometimes confusing, consequences.

Java theory and practice: Generics gotchas

Diagnosing Java code: Java generics without the pain, Part 1

J2SE 1.5 -- code-named Tiger -- is scheduled for release near the end of 2003.