Open In App

Scala Char reverseBytes() method with example

Last Updated : 03 Nov, 2019
Improve
Improve
Like Article
Like
Save
Share
Report

The reverseBytes() method is utilized to find the value obtained by reversing the sequence of the bytes in the stated char value.

Method Definition: def reverseBytes: Char

Return Type: It returns Char.

Example: 1#




// Scala program of reverseBytes()
// method
  
// Creating object
object GfG
  
    // Main method
    def main(args:Array[String])
    {
      
        // Applying reverseBytes() method 
        val result = '\u4d00'.reverseBytes
          
        // Displays output
        println(result)
      
    }


Output:

M

Example: 2#




// Scala program of reverseBytes()
// method
  
// Creating object
object GfG
  
    // Main method
    def main(args:Array[String])
    {
      
        // Applying reverseBytes() method
        val result = '\u5d00'.reverseBytes
          
        // Displays output
        println(result)
          
    }


Output:

]


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads