Scala Char getNumericValue() method with example
Last Updated :
03 Nov, 2019
The getNumericValue() method is utilized to return the numeric value of the given character.
Method Definition: def getNumericValue: Int
Return Type: It returns Integer.
Example: 1#
object GfG
{
def main(args : Array[String])
{
val result = ( 'Z' ).getNumericValue
println(result)
}
}
|
Example: 2#
object GfG
{
def main(args : Array[String])
{
val result = 'B' .getNumericValue
println(result)
}
}
|
Share your thoughts in the comments
Please Login to comment...