Scala Char toShort() method with example
Last Updated :
29 Oct, 2019
The toShort() method is utilized to convert a stated character into type Short.
Method Definition: def toShort: Short
Return Type: It returns Short.
Example: 1#
object GfG
{
def main(args : Array[String])
{
val result = '\u5555' .toLong
println(result)
}
}
|
Example: 2#
object GfG
{
def main(args : Array[String])
{
val result = '\u1111' .toShort
println(result)
}
}
|
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...