Discussions

General J2EE: Why do we need Type Inference from Java 7?

  1. Why do we need Type Inference from Java 7? (2 messages)

    Every good programmer likes to write a concise but effective and optimized code. Type Inference is a way introduced in JDK 7 which will surely give you benefits of less typing.
    Have you ever thought of code duplication while initializing the specific implementation of Collections? Why there is a need to write the parameters two times during an intialization?

    Now most of you would be thinking of initializing as a raw types as you had been doing in previous JDK version.
    So whats new in JDK 7? What benefits you will have from the new feature?

    Read the full article at

    Why do we need Type Inference from Java 7?

    Threaded Messages (2)

  2. Type Inference?[ Go to top ]

    This is not type inference. Small but ugly collection syntax hack maybe...

  3. Type Inference?[ Go to top ]

    Yeah. Frankly speaking, it is ugly. Very ugly.... Kinda disappointed for JDK7 to come out with such an idea. I would rather rely on IDE to auto generated all the type-safe syntax.

    Oracle did a bad job >.<