²»ºÃÒâ˼£¬»¹ÏëÎÊѧ³¤¼¸¸öÎÊÌâ
1¡£what is i after the following for loop?
for (int i=0;i<10;++i){
y+=i;
}
ΪʲĪ´ð°¸ÊÇundefined?²»Ó¦¸ÃÊÇ10Âð£¿
2¡£analyze the following fragment:
double sum=0;
double d=0;
while(d!=10.0){
d+=0.1;
sum+=sum+d;
}
´ð°¸£ºthe program may not stop because of the phenomenon referred t as numerical inaccuracy for uperating with floating-pointing numbers.
Ϊɶ£¿²»¶®~~~~
3¡£analyze the following code:
boolean even=false;
if(even=true){
system.out.println(" it is even!");
}
дµÃÓдíÂ𣿽á¹ûÊÇʲĪ£¿
4¡£even=number%2==0
ÓÐÕâÖÖд·¨Ã´£¿ ÊÇʲĪÒâ˼ÄØ£¿¼ÆËã»ú¿´µ½Õâ¸öexpressionºóÓÖÊÇÔõÑù¹¤×÷µÄ£¿
¶àлѧ³¤µÄ°ïÖú£¡£¡
for (int i=0;i<10;++i){
y+=i;
}
ΪʲĪ´ð°¸ÊÇundefined?²»Ó¦¸ÃÊÇ10Âð£¿
2¡£analyze the following fragment:
double sum=0;
double d=0;
while(d!=10.0){
d+=0.1;
sum+=sum+d;
}
´ð°¸£ºthe program may not stop because of the phenomenon referred t as numerical inaccuracy for uperating with floating-pointing numbers.
Ϊɶ£¿²»¶®~~~~
3¡£analyze the following code:
boolean even=false;
if(even=true){
system.out.println(" it is even!");
}
дµÃÓдíÂ𣿽á¹ûÊÇʲĪ£¿
4¡£even=number%2==0
ÓÐÕâÖÖд·¨Ã´£¿ ÊÇʲĪÒâ˼ÄØ£¿¼ÆËã»ú¿´µ½Õâ¸öexpressionºóÓÖÊÇÔõÑù¹¤×÷µÄ£¿
¶àлѧ³¤µÄ°ïÖú£¡£¡