Java: Interface with new keyword how is that possible?

前端 未结 9 1511
抹茶落季
抹茶落季 2020-12-04 08:21

I was reading some sourcecode from Java libraries, and I am confused here;

This code is from Document.java in jaxb library, and ContentVisitor is an Interfac

9条回答
  •  一向
    一向 (楼主)
    2020-12-04 08:57

    It is called anonymous type/class which implements that interface. Take a look at tutorial - Local and Anonymous Inner Classes.

提交回复
热议问题