int i=o;
void ste(){
while(i==47){
------------------这时 i=0; 所以下边的语句永远不会运行。 System.out.println(i++);
i+=1;
}
}
void ste(){
while(i==47){
------------------这时 i=0; 所以下边的语句永远不会运行。 System.out.println(i++);
i+=1;
}
}
知是为什么 我的程序如下:
public class Abc{
void ste(){
int i=o;
while(i==47){
System.out.println(i);
i+=1;
}
}
pulic static woid main (String[] args){
Abc t=new Abc();
t.ste()
}
}
不知是为什么 不显示1 2 3等 请指点
0 or o ?
void ste(){
int i=o;
while(i>=47){
System.out.println(i);
i+=1;
}
}
pulic static woid main (String[] args){
Abc t=new Abc();
t.ste()
}
}
void ste(){
int i=0;
while(i<=47){
System.out.println(i);
i+=1;
}
}
public static void main(String args[]){
Abc t=new Abc();
t.ste();
}
}
int i=o; //我想应该是:int i=0;吧?
void ste(){
while(i==47){ //只有当i=47时才会执行呀,
System.out.println(i++); //你这i++ 和i+=1;作用想同的,也就是说你执行了两次i++
i+=1;
}
}
pulic static woid main (String[] args){
Abc t=new Abc();
t.ste()
}
}应该是:public class Abc{
void ste(){
int i=o;
while(i>=47){
System.out.println(i);
i+=1;
}
}
pulic static woid main (String[] args){
Abc t=new Abc();
t.ste()
}
}