Scala Int getClass() method with example
Last Updated :
30 Jan, 2020
The getClass() method is utilized to return the class of the given int number.
Method Definition: (Number).getClass
Return Type: It returns the class of the given number.
Example #1:
object GfG
{
def main(args : Array[String])
{
val result = ( 2 ).getClass
println(result)
}
}
|
Example #2:
object GfG
{
def main(args : Array[String])
{
val result = ( 27987696 ).getClass
println(result)
}
}
|
Share your thoughts in the comments
Please Login to comment...