How to reverse the order of the bytes in a char value in Java

1 Answer

0 votes
package javaapplication1;
 
public class JavaApplication1 {
 
    public static void main(String[] args) {
 
        char ch = '\u4e00';

        char rv = Character.reverseBytes(ch);
        System.out.println(rv);
    }
}
 
/*
run:

N
 
*/

 



answered Sep 16, 2016 by avibootz

Related questions

1 answer 193 views
1 answer 139 views
1 answer 139 views
3 answers 198 views
1 answer 148 views
...