|
1
2
3
4
5
6
7
8
9
10
11 |
public class HexToInteger { public
static void main(String[] args){ int
cid = 78823423; System.out.println((short)0x00000FFFF); //-1 System.out.println(cid & (short)0x00000FFFF); //78823423 System.out.println(cid & 0x00000FFFF); //49151 System.out.println(Integer.parseInt(Integer.toHexString(cid & 0x00000FFFF), 16)); //49151 System.out.println(Integer.parseInt(String.valueOf(cid & 0x00000FFFF), 16)); //299345 System.out.println(String.valueOf(cid & 0x00000FFFF)); //49151 }} |
原文:http://www.cnblogs.com/leihupqrst/p/3604597.html