Scala Char getClass() method with example
Last Updated :
03 Nov, 2019
The getClass() method is utilized to return the run-time class representation of the stated object.
Method Definition: def getClass(): Class[Char]
Return Type: It returns the class of the stated object.
Example: 1#
object GfG
{
def main(args : Array[String])
{
val result = 'a' .getClass
println(result)
}
}
|
Example: 2#
object GfG
{
def main(args : Array[String])
{
val result = '5' .getClass
println(result)
}
}
|
Share your thoughts in the comments
Please Login to comment...