7
我正在閱讀一個Scala教程,它解釋了所有的操作符實際上是方法調用。所以1 * 2
是真的:爲什麼在一個scala方法調用int周圍的括號
scala> (1).*(2)
res1: Int = 2
只是爲了看看會發生什麼,我跑:
scala> 1.*(2)
warning: there were 1 deprecation warning(s); re-run with -deprecation for details
res2: Double = 2.0
所以我用的廢棄標誌再次運行它,我得到:
scala> 1.*(2)
<console>:1: warning: This lexical syntax is deprecated. From scala 2.11, a dot will only be considered part of a number if it is immediately followed by a digit.
1.*(2)
莫非有人請向我解釋這個警告,並且向我解釋scala> (1).*(2)
中1的圓括號的用途是什麼?