I want to use the static method Integer#bitCount(int)
.
But I found out that I'm unable to use a type alias does to achieve it. What is the difference between a type alias an an import alias ?
scala> import java.lang.{Integer => JavaInteger}
import java.lang.{Integer=>JavaInteger}
scala> JavaInteger.bitCount(2)
res16: Int = 1
scala> type F = java.lang.Integer
defined type alias F
scala> F.bitCount(2)
<console>:7: error: not found: value F
F.bitCount(2)
^