java十六进制转化为其他进制 二进制转化为其他进制 十进制转化为其他进制案例

来源:互联网 发布:linux history 命令 编辑:程序博客网 时间:2024/03/29 04:40

十六进制转化为其他进制:



二进制转化为其他进制:


代码实现:

public class Tset1 {
     public static void main(String[] args){
        System.out.println(Math.pow(2,7)+Math.pow(2,6)+Math.pow(2,5)+Math.pow(2,4)+
         Math.pow(2,3)+Math.pow(2,2)+Math.pow(2,1)+Math.pow(2,0));
 }
}

结果 :255.0

在上面代码基础上加  System.out.println(Math.pow(2, 8)-1);


十进制转化为其他进制:




原创粉丝点击