摘要:
public class TestDemo { public static void main(String[] args) { //打印正三角形 for (int i = 1; i <= 5; i++) {
评论(0)
推荐(0)
摘要:
public class ForDemo2 { public static void main(String[] args) { for (int i = 1; i <= 9; i++) { for (int j = 1; j <= i; j++) { System.out.print(i+ "*" 阅读全文
posted @ 2021-05-24 21:48
Henry`
阅读(43)
评论(0)
推荐(0)
摘要:
public class ForDemo1 { public static void main(String[] args) { //用while或for循环输出1-1000之间能被5整除的数,并且每行输出4个 for (int i = 0; i <= 1000; i++) { if (i%5==0 阅读全文
posted @ 2021-05-24 21:19
Henry`
阅读(431)
评论(0)
推荐(0)
摘要:
public class ForDemo { public static void main(String[] args) { //计算0-100之间的奇数和偶数的和 int oddSum = 0; int evenSum = 0; for (int i = 0; i < 100; i++) { i 阅读全文
posted @ 2021-05-24 21:03
Henry`
阅读(403)
评论(0)
推荐(0)
摘要:
public class Demo{ public static void main(String[] args){ Scanner scanner = new Scanner(System.in); double sum = 0;//和 int num = 0;//输入多少个数字 while(sc 阅读全文
posted @ 2021-05-24 20:16
Henry`
阅读(73)
评论(0)
推荐(0)
摘要:
next() 一定要读取到有效字符后才可以结束输入 对输入有效字符之前遇到的空白,next()方法会自动将其去掉 只有输入有效字符后才将其后面输入的空白作为分隔符或者结束符 next()不能得到带有空格的字符串 nextLine() 以Enter为结束符,也就是说nextLine()方法返回的是输入 阅读全文
posted @ 2021-05-24 19:53
Henry`
阅读(102)
评论(0)
推荐(0)
摘要:
  
评论(0)
推荐(0)
摘要:
int a = 5; boolean b = (a<4)&&(a++<4); System.out.println(b);false,因为a<4已经是false,所以a++<4不会执行 System.out.println(a);//a = 5 阅读全文
posted @ 2021-05-24 10:13
Henry`
阅读(104)
评论(0)
推荐(0)
摘要:
public class Demo{ public static void main(String[] args){ //++ -- 自增,自减 一元运算 int a = 4; int b = a++; int c = ++a; System.out.println("a="a);//a=6 Sys 阅读全文
posted @ 2021-05-24 09:50
Henry`
阅读(58)
评论(0)
推荐(0)
摘要:
所有变量、方法、类名:见名知意 类成员变量:首字母小写和驼峰原则:monthSalary 除了第一个单词以外,后面的单词首字母大写 lastName 局部变量:首字母小写和驼峰原则 常量:大写字母和下划线:MAX_VALUE 类名:首字母大写和驼峰原则:Man,GoodMan 方法名:首字母小写和驼 阅读全文
posted @ 2021-05-24 09:15
Henry`
阅读(136)
评论(0)
推荐(0)

浙公网安备 33010602011771号