摘要:
package com.lyc.struct;public class DoWhileDemo02 { public static void main(String[] args) { int a = 0; while (a<0){ System.out.println(a); a++; } Sys 阅读全文
摘要:
package com.lyc.struct;public class DoWhileDemo01 { public static void main(String[] args) { //计算1+2+3+...+100 = ? int i = 0; int sum = 0; do { i++; s 阅读全文
摘要:
package com.lyc.struct;public class WhileDemo02 { public static void main(String[] args) { //计算1+2+3+...+100 = ? int sum = 0; int i = 0; while (i<100) 阅读全文
摘要:
package com.lyc.struct;public class WhileDemo01 { public static void main(String[] args) { //输出1~100 int i =0; while (i<100){ i++; System.out.println( 阅读全文
摘要:
package com.lyc.struct;public class SwitchDemo02 { public static void main(String[] args) { String name = "史蒂夫"; //JDK7的新特性,表达式结果可以说字符串 //字符的本质还是数字 sw 阅读全文
摘要:
package com.lyc.struct;public class SwitchDemo01 { public static void main(String[] args) { //case 穿透(如果不写break ,case将会把代码执行到底,所以匹配到选项后需要用break来终止) ch 阅读全文
摘要:
package com.lyc;import java.util.Scanner;public class Demo05 { public static void main(String[] args) { //我们可以输入多个数字,并求其总和与平均数,每输入一份数字用回车确认,通过输入非数字来结束 阅读全文
摘要:
package com.lyc;import java.util.Scanner;public class Demo04 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); //从键 阅读全文
摘要:
package com.lyc;import java.util.Scanner;public class Demo03 { public static void main(String[] args) { //创建一个扫描对象,用于接收键盘数据 Scanner scanner = new Scan 阅读全文