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