提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
将十进制整数转换为八进制数示例
/** n o w j a v a . c o m - 时 代 Java 提 供 **/ public class Main { public static void main(String[] args) { int i = 27; String strOctalNumber = Integer.toOctalString(i); System.out.println("Convert decimal number to octal number example"); System.out.println("Octal value of " + i + " is " + strOctalNumber); } }