Is Groovy syntax an exact superset of Java syntax?

前端 未结 4 1836
春和景丽
春和景丽 2021-01-01 10:06

Being a Java programmer, I don\'t really have a Groovy background, but I use Groovy a lot lately to extend Maven (using GMaven). So far, I could use all the Java code I need

4条回答
  •  耶瑟儿~
    2021-01-01 10:13

    It isn't.

    My favorite incompatibility: literal arrays:

    String[] s = new String[] {"a", "b", "c"};
    

    In Groovy, curly braces in this context would be expected to contain a closure, not a literal array.

提交回复
热议问题