错误:
class operatedemo3
{
public static void main(String[] args)
{
int nuo=60; //num错打成nuo
int four1,four2;
four1=num&15;
num>>4; //(1)num>>4只是一个位运算,并不会直接改变num,还需要再赋值》》》num=num>>4;
four2=num&15;
System.out.println("four1="+four1",four2="+four2);//输出语句出错
}
}
正确
class operatedemo3
{
public static void main(String[] args)
{
int num=60;
int four1,four2;
four1=num&15;
four1=four1-10+'a';
num=num>>4;
four2=num&15;
System.out.print((char)four1);
System.out.println(four2);
}
}