Double brace initialisation (anonymous inner class) with diamond operator

后端 未结 4 1543
轻奢々
轻奢々 2020-12-10 13:44

I am wondering why the second map declaration (using the diamond operator) does not compile when the first one does. Compilation error:

error: cannot

4条回答
  •  不知归路
    2020-12-10 14:24

    This feature is part of Project Coin 2 and will be avalaible in Java 9 coming September 22 of 2016.

    It's call Allowing the diamond syntax with some anonymous class constructors.

    Link.

提交回复
热议问题