作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
只是想知道为什么我在 REPL 中看到以下内容:
scala> 5.+(9)警告:有 1 条弃用警告;使用 -deprecation 重新运行以获取详细信息res18:双倍 = 14.0
最佳答案
如果您按照说明操作并使用 scala -deprecation
运行 REPL,您将看到弃用的原因:
scala> 1 + 1
res0: Int = 2
scala> 1.+(1)
<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.+(1)
^
res1: Double = 2.0
在 Scala 2.10.1 上测试
关于scala - 为什么 .+() 方法在 scala 中被弃用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21498021/
我是一名优秀的程序员,十分优秀!