摘要:
流程控制4 break public class BreakDemo { public static void main(String[] args) { int i = 0; while (i<100){ System.out.println(i); i++; if (i==30){ break; 阅读全文
摘要:
流程控制3 循环结构 Java5中新增了一个增强版的for循环 while循环 public class WhileDemo01 { public static void main(String[] args) { // 输入1-100 int i =0; while (i<100){//布尔表达式 阅读全文
摘要:
流程控制2 IF 单选泽结构 public class IfDemo01 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.println("请输入内容:") 阅读全文
摘要:
09 类型转换补充 //在数字较大时注意溢出 //JDK7特性,_可以用来分隔数字,最终不会输出 int money = 10_00000_000; int years = 20; int total = money*years; System.out.println(total); long to 阅读全文