摘要:
方法的定义和调用 package zaiyang.method; public class Demo02 { public static void main(String[] args) { int max = max(100,10); System.out.println(max); } //比大 阅读全文
摘要:
什么是方法 package zaiyang.method; public class Demo01 { //main方法 public static void main(String[] args) { int sum = add(5,14); System.out.println(sum); } 阅读全文
摘要:
打印三角形及Debug package zaiyang.struct; public class TestDemo { public static void main(String[] args) { //打印三角形 5行 for (int i = 1; i <= 5; i++) { for (in 阅读全文
摘要:
Break Continue循环终止用法 package zaiyang.struct; public class BreakDemo { public static void main(String[] args) { int i = 0; while (i<100){ i++; System.o 阅读全文
摘要:
增强for循环 package zaiyang.struct; public class ForDemo06 { public static void main(String[] args) { int [] numbers = {10,20,30,40,50};//定义了一个数组 for (int 阅读全文
摘要:
For循环详解 package zaiyang.struct; public class ForDemo01 { public static void main(String[] args) { int a = 1;//初始化条件 while (a <= 100) {//条件判断 System.ou 阅读全文
摘要:
DoWhile循环 package zaiyang.struct; public class DoDemo01 { public static void main(String[] args) { int i = 0; int sum = 0; do { sum = sum + i; i++; }w 阅读全文
摘要:
while循环详解 package zaiyang.struct; public class WhileDemo01 { public static void main(String[] args) { //输出1~100 int i = 0; while (i<100){ i++; System. 阅读全文