arithmetic

 Today I have some questions, then ,  could  somebody tell me why?

Why  j is not 4 but 5?  My memory error?

<!--EndFragment--> <!--EndFragment-->
public class sugizo_can{
 public static void main(String args[])
{int i=8,j=4,l=0;
int a=5,b=6;
float f=1.0f;
double d=2.5d;
int m=i%j;

f=i/j;
l=++i+j++;
System.out.println("f="+f);
System.out.println("l="+l);
System.out.println("i="+i);
System.out.println("j="+j);//I think it's must be 4,but why 5?


int c=a>b?a:b;
System.out.println("c="+c);

d+=a;
System.out.println("d+a="+d);
int n=(int)(d+b);
System.out.println("n="+n);
boolean bool=a>b;
System.out.println("bool="+bool);
boolean firstbool=true;
boolean secondbool=bool&&firstbool;
System.out.println("secondbool="+secondbool);

String s="Good morning,sugizo_can!";
System.out.println(s);
}
}

 

look the result:

<!--EndFragment-->
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值