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 291 views
1 answer 228 views
1 answer 224 views
3 answers 341 views
1 answer 225 views
...