What packages does 1) Java and 2) Groovy automatically import?

后端 未结 3 1441
悲&欢浪女
悲&欢浪女 2021-02-18 23:55

Having programmed in Groovy quite a bit I know classes in certain packages are automatically imported. What\'s the scoop for 1) Java and 2) Groovy? Is there a definitive list of

3条回答
  •  我寻月下人不归
    2021-02-19 00:10

    AFAIK, java only imports

    java.lang.*
    

    wheras groovy imports:

    java.io.*
    java.lang.*
    java.math.BigDecimal
    java.math.BigInteger
    java.net.*
    java.util.*
    groovy.lang.*
    groovy.util.*
    

    According to https://groovy-lang.org/differences.html#_default_imports

提交回复
热议问题