📌  相关文章
📜  二进制到八进制转换java程序 - Java代码示例

📅  最后修改于: 2022-03-11 14:52:27.610000             🧑  作者: Mango

代码示例1
// conversion of binary to octal in java..
public class Main{
    public static void main(String args[]) throws Exception{
        String binary = "1100100";                // binary number.. 
        int decimal = Integer.parseInt(binary,2); // converting binary to decimal
        System.out.println(Integer.toOctalString(decimal)); // 144 <= octal output..  
    }
}