1,什么是循环
2,死循环while(true)
package struct;
public class WhileDomen01 {
public static void main(String[] args) {
int i=0;
while(i<100){
i++;
System.out.println(i);
}
}
}
package struct;
//实现从1+100的和
public class WhileDomen02 {
public static void main(String[] args) {
int i=0;
int sum=0;
while(i<=100){
sum=sum+i;
i++;
}
System.out.println(sum);
}
}