Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-core-dev] [1.5] Generic methods



Basic support for generic methods is now in, with argument type inference.
For instance, in the example below, U is inferred to be of type String for
the invocation of #foo(...) in #main(...) method.

public class X <T> {
    public static void main(String[] args) {
            new X<String>().foo(args, new X<X<String>>());
      }

    <U> void foo(U[] us, X<X<U>> xxu) {
        System.out.println("SUCCESS");
    }
}

We still need to test it a bit before updating the Cheetah with it.



Back to the top