Scala Int toChar() method with example
Last Updated :
04 Feb, 2020
The toChar() method is utilized to convert the specified int number into char type value.
Method Definition: (Number).toChar
Return Type: It returns the converted char datatype value.
Example #1:
object GfG
{
def main(args : Array[String])
{
val result = ( 64 ).toChar
println(result)
}
}
|
Example #2:
object GfG
{
def main(args : Array[String])
{
val result = ( 68 ).toChar
println(result)
}
}
|
Share your thoughts in the comments
Please Login to comment...