Scala Float getClass() 方法及示例
getClass() 方法 用于返回给定数字的类。
方法定义:(Number).getClass
返回类型:返回给定数字的类。
示例 #1:
// Scala program of Float getClass()
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying getClass method
val result = (2).getClass
// Displays output
println(result)
}
}
int
示例 #2:
// Scala program of Float getClass()
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying getClass method
val result = (2.6).getClass
// Displays output
println(result)
}
}
double
更多Scala相关文章,请阅读:Scala 教程
极客教程