Scala Int 底层()方法与示例
底层()方法用于返回相同的指定整数值。
Method Definition: def underlying(): AnyRef
Return Type: It returns the same specified integer value.
示例 #1:
// Scala program of Int underlying
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying underlying method
val result = (5).underlying
// Displays output
println(result)
}
}
输出:
5
示例 #2:
// Scala program of Int underlying
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying underlying method
val result = (100).underlying
// Displays output
println(result)
}
}
输出:
100