java.lang.Character.reverseBytes(char ch)


java.lang.Character.reverseBytes(char ch)

package com.codingdict;



import java.lang.*;



public class CharacterDemo {



   public static void main(String[] args) {



      // create 2 char primitives ch1, ch2

      char ch1, ch2;



      // assign value to ch1

      ch1 = '\u4d00';



      // assign result of reverseBytes on ch1 to ch2

      ch2 = Character.reverseBytes(ch1);



      String str = "Reversing bytes on ch1 gives " + ch2;



      // print ch2 value

      System.out.println( str );

   }

}