我正在使用一个声明为整数的变量,发现 > 不是整数的成员。这是一个简单的例子:
scala> i
warning: there were deprecation warnings; re-run with -deprecation for details
res28: Integer = 3
scala> i > 3
<console>:6: error: value > is not a member of Integer
i > 3
^
将其与 Int 进行比较:
scala> j
res30: Int = 3
scala> j > 3
res31: Boolean = false
整数和整数有什么区别?我看到了弃用警告,但我不清楚它为什么被弃用,鉴于它已经被弃用,为什么它没有 > 方法。