Scala Long toChar() method with example
Last Updated :
03 Nov, 2019
The toChar() method is utilized to convert the specified number into character value. Here the specified number is ASCII value.
Method Definition: (Number).toChar
Return Type: It returns the converted character value.
Example 1:
object Test
{
def main(args : Array[String])
{
val res = ( 68 ).toChar
println(res)
}
}
|
Output:
D
Example 2:
object Test
{
def main(args : Array[String])
{
val res = ( 82 ).toChar
println(res)
}
}
|
Output:
R
Share your thoughts in the comments
Please Login to comment...