摘要: package Struck;public class ForDemo01 { public static void main(String[] args) { int a = 0;//初始化条件 while(a<100){//循环体 System.out.println(a); a++;//对a的 阅读全文
posted @ 2022-06-19 23:29 暮阳人 阅读(29) 评论(0) 推荐(0)
摘要: package Struck;public class WhileDemo01 { public static void main(String[] args) { //输出1-100 int i = 0; while (i<100){ i++; System.out.println(i); } } 阅读全文
posted @ 2022-06-19 23:26 暮阳人 阅读(25) 评论(0) 推荐(0)
摘要: package Struck;public class SwitchDemo01 { public static void main(String[] args) { //case 穿透性 //switch 匹配一个具体的值 char grade = 'C'; switch (grade){ cas 阅读全文
posted @ 2022-06-19 01:14 暮阳人 阅读(26) 评论(0) 推荐(0)
摘要: package Struck;import java.util.Scanner;public class IfDemo01 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); Sys 阅读全文
posted @ 2022-06-19 01:12 暮阳人 阅读(24) 评论(0) 推荐(0)
摘要: package Sanner;import java.util.Scanner;public class Demo01 { public static void main(String[] args) { //创建一个扫描器对象,用于接受键盘数据 new Scanner(System.in);//o 阅读全文
posted @ 2022-06-18 00:13 暮阳人 阅读(106) 评论(0) 推荐(0)
摘要: package base;// /**是注解 //是注释/** * @author Zhaomouren(作者名) * @version 1.0 (版本) * @since 1.8 (需要最早使用的jdk版本) *///加在类上是类注释public class Doc { String name; 阅读全文
posted @ 2022-06-17 22:01 暮阳人 阅读(103) 评论(0) 推荐(0)
摘要: package operator;//逻辑运算符public class Demo05 { public static void main(String[] args) { //与(and) 或(or) 非(取反) boolean a = true; boolean b = false; Syste 阅读全文
posted @ 2022-06-16 20:06 暮阳人 阅读(26) 评论(0) 推荐(0)
摘要: 二元运算符 package operator;public class Demo01 { public static void main(String[] args) { //二元运算符 //复制当前行到下一行 int a = 10; int b = 20; int c = 25; int d = 阅读全文
posted @ 2022-06-16 18:07 暮阳人 阅读(27) 评论(0) 推荐(0)
摘要: public class Demo03 {//生成一个名叫Demo03的类 //类变量 static static double salary = 2500;//声明一个静态浮点数salary并赋值为2500 //属性:变量 //实例变量:从属于对象:如果不初始化,则输出为该类型的默认值 0 / 0 阅读全文
posted @ 2022-06-15 23:06 暮阳人 阅读(25) 评论(0) 推荐(0)
摘要: public class 数据类型2 { public static void main(String[] args) { //整数拓展:进制 二进制0b 十进制 八进制0 十六进制0x int i = 10; int i2 = 010; //八进制 int i3 = 0x10;//十六进制 int 阅读全文
posted @ 2022-06-14 20:18 暮阳人 阅读(29) 评论(0) 推荐(0)