Scala Char getType() method with example
Last Updated :
03 Nov, 2019
The getType() method is utilized to return a value of type integer representing the character’s general category.
Method Definition: def getType: Int
Return Type: It returns an Integer.
Example: 1#
object GfG
{
def main(args : Array[String])
{
val result = 'B' .getType
println(result)
}
}
|
Here, the category of ‘B’ is 1.
Example: 2#
object GfG
{
def main(args : Array[String])
{
val result = ( '%' ).getType
println(result)
}
}
|
Here, the category of ‘%’ is 24.
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...