Scala Float getClass() method with example
Last Updated :
29 Oct, 2019
The getClass() method is utilized to return the class of the given 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 = ( 2.6 ).getClass
println(result)
}
}
|
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...