3 回答

TA贡献1853条经验 获得超9个赞
out
类中的静态字段java.lang.System
具有类型java.io.PrintStream
。类PrintStream
有几种write()
方法。在您的代码中,您传递给方法的参数write()
是 an int
,因此方法 invokde 是write(int)
。您正在为局部变量分配一个数字文字b
。在 java 中,以零 (0) 开头的数字文字表示八进制数,八进制中的65是十进制中的 53(五十三),而 53 是数字 5(五)的 ASCII 码。供您参考,类java.lang.Integer
有静态方法toBinaryString()
。我建议您查看该方法的 javadoc。

TA贡献1943条经验 获得超7个赞
public class StackOverFlow{
public static void main(String []args){
int x = 0065;// in java when you append zero like 011 or 0023 its take as octal number,when you print it will convert to decimal
System.out.println(x); // 0065 is octal value when you convert to decimal it will be 53 and in hexa 35
int y = 056;//octal value
System.out.println(y); // Output:46 decimal value
}
}
添加回答
举报