hhafez
hhafez

Reputation: 39750

What rules are used for type inference when using Generics

Does anyone know where I can find a discussion on how type inference works when using Generics in Java.

Upvotes: 3

Views: 831

Answers (3)

vladr
vladr

Reputation: 66661

This is originally specified in Section 15.12.2.7 of the Java Language Specification, as a result of the Java Specification Requests #14.

You may also find various discussions on the subject, such as Generics - type inference from context or Type Argument Inference at the Generics FAQ, etc.

Upvotes: 3

Ray Tayek
Ray Tayek

Reputation: 10003

i had to read the book: https://java-generics-book.dev.java.net/

Upvotes: 0

jdigital
jdigital

Reputation: 12276

I recommend Angelika Langer's site for more information on Java generics. She does have a discussion on type inference.

Upvotes: 0

Related Questions