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 292 views
1 answer 231 views
1 answer 226 views
3 answers 349 views
1 answer 226 views
...