首页 > 代码库 > What does “=>” mean in import in scala?(转自StackOverflow问答)
What does “=>” mean in import in scala?(转自StackOverflow问答)
|
As others have mentioned, it‘s an import rename. There is however one further feature that proves astoundingly-useful on occasion that I would like to highlight: If you "rename" to This is useful in a few cases. The simplest is that you‘d like to do a wildcard import from two packages, but there‘s a name that‘s defined in both and you‘re only interested in one of them:
Now when you reference In that case, you could have also renamed
|
参考链接:
https://stackoverflow.com/questions/31652959/what-does-mean-in-import-in-scala
What does “=>” mean in import in scala?(转自StackOverflow问答)