Shall we expect same behavior for bridge method

Tristan Yan tristan.yan at
Thu Sep 19 11:11:03 PDT 2013

Lambda expression behaves different on bridge method, check the code below, are we implementing such a way on purpose? 


       Consumer<Base> bc = b -> b.test("Hello");

        Sub sb = new Sub();

        bc.accept(sb);      //call Base class's test


        sb.test("Hello");   // call Base class's test


class Base<T>{

    public void test(T t){ System.out.println("Base"); }



class Sub<T> extends Base<T>{

    public void test(String s){ System.out.println("Sub"); }


Tristan Yan(Haibo Yan)

Office : 8610-61066212

Fax  : 8610-61065441

Cell  : 86-18610696822


2F, Building No. 24, Zhongguancun Software Park

Haidian District HYPERLINK ""Beijing , 100193



More information about the lambda-dev mailing list