diff --git "a/51\345\217\267 \347\250\213\350\210\234/20221126 java\345\217\230\351\207\217.md" "b/51\345\217\267 \347\250\213\350\210\234/20221126 java\345\217\230\351\207\217.md" new file mode 100644 index 0000000000000000000000000000000000000000..f4ff0c9772115ffa56a7ad0d59092a9891058492 --- /dev/null +++ "b/51\345\217\267 \347\250\213\350\210\234/20221126 java\345\217\230\351\207\217.md" @@ -0,0 +1,65 @@ +# java笔记 + +1.1、整数 + +``` java +byte short int 定义 long 数据后要加L +``` + + + +1.2、布尔 + +```java +boolean +``` + + + +1.3、浮点数 + +```java +定义 float 数据后要加F double +``` + + + +1.4、字符串 + +```java +String +``` + + + +1.5、字符 + +```java +char sos ='男'; +``` + + + + + +# 作业 + +```java +public class Wdsj { + public static void main(String[] args) { + String name = "念哥"; + int age = 18; + char gender= '帅'; + String btring="199有余,"; + String satSomthing ="我们都很好。"; + System.out.println(name+"今年"+age+ "岁了,身高"+btring+"念哥很"+gender+"对"+satSomthing); + String name1 ="念哥,"; + String bommom ="花儿,你是光。"; + String badle ="闽大最帅男教师。"; + String badlr = "天天开心快乐。"; + System.out.println(name1+"你是"+bommom+"你是"+badle); + System.out.println("祝念哥"+badlr); + } +} +``` + diff --git "a/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21027\346\227\245\344\275\234\344\270\232 51\345\217\267.md" "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21027\346\227\245\344\275\234\344\270\232 51\345\217\267/2022\345\271\26411\346\234\21027\346\227\245\344\275\234\344\270\232 51\345\217\267.md" similarity index 70% rename from "51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21027\346\227\245\344\275\234\344\270\232 51\345\217\267.md" rename to "51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21027\346\227\245\344\275\234\344\270\232 51\345\217\267/2022\345\271\26411\346\234\21027\346\227\245\344\275\234\344\270\232 51\345\217\267.md" index da9bef2d10ab2678bc68ed25f78ac52f2abaf4ff..cc286431336f6eef1bcc9f8e3ee82ee685017c3e 100644 --- "a/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21027\346\227\245\344\275\234\344\270\232 51\345\217\267.md" +++ "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21027\346\227\245\344\275\234\344\270\232 51\345\217\267/2022\345\271\26411\346\234\21027\346\227\245\344\275\234\344\270\232 51\345\217\267.md" @@ -1,3 +1,45 @@ +# java笔记 + +1.1、整数 + +``` java +byte short int 定义 long 数据后要加L +``` + + + +1.2、布尔 + +```java +boolean +``` + + + +1.3、浮点数 + +```java +定义 float 数据后要加F double +``` + + + +1.4、字符串 + +```java +String +``` + + + +1.5、字符 + +```java +char sos ='男'; +``` + +### 作业 + ```java public class zuoye2 { public static void main(String[] args) { diff --git "a/51\345\217\267 \347\250\213\350\210\234/zuoye.java" "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21027\346\227\245\344\275\234\344\270\232 51\345\217\267/zuoye.java" similarity index 100% rename from "51\345\217\267 \347\250\213\350\210\234/zuoye.java" rename to "51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21027\346\227\245\344\275\234\344\270\232 51\345\217\267/zuoye.java" diff --git "a/51\345\217\267 \347\250\213\350\210\234/zuoye2.java" "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21027\346\227\245\344\275\234\344\270\232 51\345\217\267/zuoye2.java" similarity index 100% rename from "51\345\217\267 \347\250\213\350\210\234/zuoye2.java" rename to "51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21027\346\227\245\344\275\234\344\270\232 51\345\217\267/zuoye2.java" diff --git "a/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/.idea/.gitignore" "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/.idea/.gitignore" new file mode 100644 index 0000000000000000000000000000000000000000..35410cacdc5e87f985c93a96520f5e11a5c822e4 --- /dev/null +++ "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/.idea/.gitignore" @@ -0,0 +1,8 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml +# 基于编辑器的 HTTP 客户端请求 +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git "a/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/.idea/misc.xml" "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/.idea/misc.xml" new file mode 100644 index 0000000000000000000000000000000000000000..8ed5f34df8494ed90108ce6a2ebd4fa2a8296e95 --- /dev/null +++ "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/.idea/misc.xml" @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git "a/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/.idea/modules.xml" "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/.idea/modules.xml" new file mode 100644 index 0000000000000000000000000000000000000000..047e0fe1d3ff9f3cf13111af4182ad093a1ae4d5 --- /dev/null +++ "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/.idea/modules.xml" @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git "a/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/.idea/vcs.xml" "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/.idea/vcs.xml" new file mode 100644 index 0000000000000000000000000000000000000000..b2bdec2d71b6a5ce4ae49efc37516809c50e4d5e --- /dev/null +++ "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/.idea/vcs.xml" @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git "a/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/2022\345\271\26411\346\234\21028\346\227\245 51\345\217\267.md" "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/2022\345\271\26411\346\234\21028\346\227\245 51\345\217\267.md" new file mode 100644 index 0000000000000000000000000000000000000000..7a231425083002bb5bf07d66264536d971e839a2 --- /dev/null +++ "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/2022\345\271\26411\346\234\21028\346\227\245 51\345\217\267.md" @@ -0,0 +1,198 @@ +### java语法笔记 + +1 类型转换 + +1.1 隐式转换(理解) + +把一个表示数据范围小的数值或者变量赋值给另一个表示数据范围大的变量。这种转换方式是自动的,直接书写即可。例如: + +```java +double num = 10; // 将int类型的10直接赋值给double类型 +System.out.println(num); // 输出10.0 +``` + +### 1.2 强制转换(理解) + +​ 把一个表示数据范围大的数值或者变量赋值给另一个表示数据范围小的变量。 + +​ 强制类型转换格式:目标数据类型 变量名 = (目标数据类型)值或者变量; + +​ 例如: + +```java +double num1 = 5.5; +int num2 = (int) num1; // 将double类型的num1强制转换为int类型 +System.out.println(num2); // 输出5(小数位直接舍弃) +``` + +## 2. 运算符 + +### 2.1 算术运算符 + +#### 2.1.1 运算符和表达式(了解) + +运算符:对常量或者变量进行操作的符号 + +表达式:用运算符把常量或者变量连接起来符合Java语法的式子就可以称为表达式。 + +​ 不同运算符连接的表达式体现的是不同类型的表达式。 + +举例说明: + +```java +int a = 10; +int b = 20; +int c = a + b; +``` + + +:是运算符,并且是算术运算符。 + + a + b:是表达式,由于+是算术运算符,所以这个表达式叫算术表达式。 + +#### 2.1.2 算术运算符(应用) + +| 符号 | 作用 | 说明 | +| :--: | :--: | ---------------------------- | +| + | 加 | 参看小学一年级 | +| - | 减 | 参看小学一年级 | +| * | 乘 | 参看小学二年级,与“×”相同 | +| / | 除 | 参看小学二年级,与“÷”相同 | +| % | 取余 | 获取的是两个数据做除法的余数 | + +**注意:** + +1. /和%的区别:两者都做除法, + - / 取结果的商, + + - % 取结果的余数。 + +2. 整数操作只能得到整数,要想得到小数,必须有浮点数参与运算。 + +~~~java +int a = 10; +int b = 3; +System.out.println(a / b); // 输出结果 +System.out.println(a % b); // 输出结果 +~~~ + +> + +#### 2.1.3 字符的“+”操作(理解) + +char类型参与算术运算,使用的是计算机底层对应的十进制数值。需要我们记住三个字符对应的数值: + +'a' -- 97 a-z是连续的,所以'b'对应的数值是98,'c'是99,依次递加 + +'A' -- 65 A-Z是连续的,所以'B'对应的数值是66,'C'是67,依次递加 + +'0' -- 48 0-9是连续的,所以'1'对应的数值是49,'2'是50,依次递加 + +**提升规则:** + +```java +1. byte类型,short类型和char类型将被提升到int类型,不管是否有其他类型参与运算。 +2. 整个表达式的类型自动提升到与表达式中最高等级的操作数相同的类型 +3. 等级顺序:byte,short,char --> int --> long --> float --> double +``` + +#### 2.1.4 字符串的“+”操作(理解) + +当“+”操作中出现字符串时,这个”+”是字符串连接符,而不是算术运算。 + +~~~java +System.out.println("qiuqiu"+ 666); // 输出:qiuqiu666 +~~~ + +在”+”操作中,如果出现了字符串,就是连接运算符,否则就是算术运算。当连续进行“+”操作时,从左到右逐个执行。 + +~~~java +System.out.println(1 + 99 + "年白酒"); // 输出:100年白酒 +System.out.println(1 + 2 + "兔子" + 3 + 4); // 输出:3兔子34 +// 可以使用小括号改变运算的优先级 +System.out.println(1 + 2 + "兔子" + (3 + 4)); // 输出:3兔子7 +~~~ + + + +```java +import java.util.Scanner; +public class Test { + public static void main(String[] args) { + // 1:使用Scanner键盘录入一个三位数 + Scanner sc = new Scanner(System.in); + System.out.println("请输入一个三位数"); + int num = sc.nextInt(); + // 2:个位的计算:数值 % 10 + int ge = num % 10; + // 3:十位的计算:数值 / 10 % 10 + int shi = num / 10 % 10; + // 4:百位的计算:数值 / 100 + int bai = num / 100; + // 5:将个位, 十位, 百位拼接上正确的字符串, 打印即可 + System.out.println("整数"+num+"个位为:" + ge); + System.out.println("整数"+num+"十位为:" + shi); + System.out.println("整数"+num+"百位为:" + bai); + + } +} +``` + +### 作业 + +```java +import java.util.Scanner; + +public class text { + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + System.out.println("请输入一个四位数"); + int num = sc.nextInt(); + int ge = num%10; + int shi = num/10%10; + int bai = num/100%10; + int qian = num/1000; + System.out.println("个位数是:"+ge); + System.out.println("十位数是:"+shi); + System.out.println("百位数是:"+bai); + System.out.println("千位数是:"+qian); + } +} +``` + +```java +import java.util.Scanner; + +public class temp { + public static void main(String[] args) { + Scanner sc =new Scanner(System.in); + System.out.println("请输入华氏度"); + double hsd = sc.nextInt(); + double s = (hsd-32)*5/9; + System.out.println("摄氏度是:"+s); + System.out.println("请输入摄氏度"); + double ssd = sc.nextInt(); + double h = ssd*9/5+32; + System.out.println("华氏度是:"+h); + } +} +``` + +```java +import java.util.Scanner; + +public class year { + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + System.out.println("请输入一个年份"); + int year = sc.nextInt(); + int yes= year%4; + if (yes==0 && year%100!=0){ + System.out.println("是闰年"); + } + else{ + System.out.println("是平年"); + } + + } +} +``` \ No newline at end of file diff --git "a/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267.iml" "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267.iml" new file mode 100644 index 0000000000000000000000000000000000000000..b107a2dd81165eaaf682ad3da030668b937fbb6c --- /dev/null +++ "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267.iml" @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git "a/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/out/production/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/.idea/.gitignore" "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/out/production/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/.idea/.gitignore" new file mode 100644 index 0000000000000000000000000000000000000000..35410cacdc5e87f985c93a96520f5e11a5c822e4 --- /dev/null +++ "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/out/production/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/.idea/.gitignore" @@ -0,0 +1,8 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml +# 基于编辑器的 HTTP 客户端请求 +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git "a/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/out/production/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/.idea/misc.xml" "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/out/production/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/.idea/misc.xml" new file mode 100644 index 0000000000000000000000000000000000000000..8ed5f34df8494ed90108ce6a2ebd4fa2a8296e95 --- /dev/null +++ "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/out/production/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/.idea/misc.xml" @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git "a/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/out/production/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/.idea/modules.xml" "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/out/production/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/.idea/modules.xml" new file mode 100644 index 0000000000000000000000000000000000000000..047e0fe1d3ff9f3cf13111af4182ad093a1ae4d5 --- /dev/null +++ "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/out/production/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/.idea/modules.xml" @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git "a/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/out/production/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/.idea/vcs.xml" "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/out/production/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/.idea/vcs.xml" new file mode 100644 index 0000000000000000000000000000000000000000..b2bdec2d71b6a5ce4ae49efc37516809c50e4d5e --- /dev/null +++ "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/out/production/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/.idea/vcs.xml" @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git "a/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/out/production/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267.iml" "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/out/production/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267.iml" new file mode 100644 index 0000000000000000000000000000000000000000..b107a2dd81165eaaf682ad3da030668b937fbb6c --- /dev/null +++ "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/out/production/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267.iml" @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git "a/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/out/production/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/temp.class" "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/out/production/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/temp.class" new file mode 100644 index 0000000000000000000000000000000000000000..1ef5ec6e7abdac14acecf5bb082f9df2067aeac1 Binary files /dev/null and "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/out/production/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/temp.class" differ diff --git "a/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/out/production/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/text.class" "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/out/production/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/text.class" new file mode 100644 index 0000000000000000000000000000000000000000..dd9bedbe97b0bcf7f4d8de06075ecd1e687ee1c0 Binary files /dev/null and "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/out/production/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/text.class" differ diff --git "a/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/out/production/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/year.class" "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/out/production/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/year.class" new file mode 100644 index 0000000000000000000000000000000000000000..a538882f3228583a8fb5c0d470c931273d545f5d Binary files /dev/null and "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/out/production/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/year.class" differ diff --git "a/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/temp.java" "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/temp.java" new file mode 100644 index 0000000000000000000000000000000000000000..0888c6ee0a691a754c0e77670957bddb76740483 --- /dev/null +++ "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/temp.java" @@ -0,0 +1,15 @@ +import java.util.Scanner; + +public class temp { + public static void main(String[] args) { + Scanner sc =new Scanner(System.in); + System.out.println("请输入华氏度"); + double hsd = sc.nextInt(); + double s = (hsd-32)*5/9; + System.out.println("摄氏度是:"+s); + System.out.println("请输入摄氏度"); + double ssd = sc.nextInt(); + double h = ssd*9/5+32; + System.out.println("华氏度是:"+h); + } +} \ No newline at end of file diff --git "a/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/text.java" "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/text.java" new file mode 100644 index 0000000000000000000000000000000000000000..68b54570d96e31ac43646fd8164d7d1337666ee0 --- /dev/null +++ "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/text.java" @@ -0,0 +1,17 @@ +import java.util.Scanner; + +public class text { + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + System.out.println("请输入一个四位数"); + int num = sc.nextInt(); + int ge = num%10; + int shi = num/10%10; + int bai = num/100%10; + int qian = num/1000; + System.out.println("个位数是:"+ge); + System.out.println("十位数是:"+shi); + System.out.println("百位数是:"+bai); + System.out.println("千位数是:"+qian); + } +} diff --git "a/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/year.java" "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/year.java" new file mode 100644 index 0000000000000000000000000000000000000000..8ae2ac9fc520ee9fad27c57ceaa52b757d4710f0 --- /dev/null +++ "b/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21028\346\227\245\344\275\234\344\270\232 51\345\217\267/year.java" @@ -0,0 +1,17 @@ +import java.util.Scanner; + +public class year { + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + System.out.println("请输入一个年份"); + int year = sc.nextInt(); + int yes= year%4; + if (yes==0 && year%100!=0){ + System.out.println("是闰年"); + } + else{ + System.out.println("是平年"); + } + + } +} diff --git "a/51\345\217\267 \347\250\213\350\210\234/out/production/51\345\217\267 \347\250\213\350\210\234/20221126 java\345\217\230\351\207\217.md" "b/51\345\217\267 \347\250\213\350\210\234/out/production/51\345\217\267 \347\250\213\350\210\234/20221126 java\345\217\230\351\207\217.md" new file mode 100644 index 0000000000000000000000000000000000000000..f4ff0c9772115ffa56a7ad0d59092a9891058492 --- /dev/null +++ "b/51\345\217\267 \347\250\213\350\210\234/out/production/51\345\217\267 \347\250\213\350\210\234/20221126 java\345\217\230\351\207\217.md" @@ -0,0 +1,65 @@ +# java笔记 + +1.1、整数 + +``` java +byte short int 定义 long 数据后要加L +``` + + + +1.2、布尔 + +```java +boolean +``` + + + +1.3、浮点数 + +```java +定义 float 数据后要加F double +``` + + + +1.4、字符串 + +```java +String +``` + + + +1.5、字符 + +```java +char sos ='男'; +``` + + + + + +# 作业 + +```java +public class Wdsj { + public static void main(String[] args) { + String name = "念哥"; + int age = 18; + char gender= '帅'; + String btring="199有余,"; + String satSomthing ="我们都很好。"; + System.out.println(name+"今年"+age+ "岁了,身高"+btring+"念哥很"+gender+"对"+satSomthing); + String name1 ="念哥,"; + String bommom ="花儿,你是光。"; + String badle ="闽大最帅男教师。"; + String badlr = "天天开心快乐。"; + System.out.println(name1+"你是"+bommom+"你是"+badle); + System.out.println("祝念哥"+badlr); + } +} +``` + diff --git "a/51\345\217\267 \347\250\213\350\210\234/out/production/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21027\346\227\245\344\275\234\344\270\232 51\345\217\267/2022\345\271\26411\346\234\21027\346\227\245\344\275\234\344\270\232 51\345\217\267.md" "b/51\345\217\267 \347\250\213\350\210\234/out/production/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21027\346\227\245\344\275\234\344\270\232 51\345\217\267/2022\345\271\26411\346\234\21027\346\227\245\344\275\234\344\270\232 51\345\217\267.md" new file mode 100644 index 0000000000000000000000000000000000000000..cc286431336f6eef1bcc9f8e3ee82ee685017c3e --- /dev/null +++ "b/51\345\217\267 \347\250\213\350\210\234/out/production/51\345\217\267 \347\250\213\350\210\234/2022\345\271\26411\346\234\21027\346\227\245\344\275\234\344\270\232 51\345\217\267/2022\345\271\26411\346\234\21027\346\227\245\344\275\234\344\270\232 51\345\217\267.md" @@ -0,0 +1,67 @@ +# java笔记 + +1.1、整数 + +``` java +byte short int 定义 long 数据后要加L +``` + + + +1.2、布尔 + +```java +boolean +``` + + + +1.3、浮点数 + +```java +定义 float 数据后要加F double +``` + + + +1.4、字符串 + +```java +String +``` + + + +1.5、字符 + +```java +char sos ='男'; +``` + +### 作业 + +```java +public class zuoye2 { + public static void main(String[] args) { + System.out.println("我爱软工2班 我爱念哥"); + } + +} +``` + +```java +public class zuoye { + public static void main(String[] args) { + String name="念哥"; + int age=18; + String gender="男"; + String number="15"; + System.out.println("我的班主任是"+name); + System.out.println("性别:"+gender); + System.out.println("他的年龄永远是"+age); + System.out.println(name+",你是花儿,你是光.你是闽大顶呱呱."); + System.out.println(number+"个赞就能让孩子完成作业,感谢各位帅哥美女!!!"); + } +} +``` + diff --git "a/51\345\217\267 \347\250\213\350\210\234/out/production/51\345\217\267 \347\250\213\350\210\234/lianxi1.class" "b/51\345\217\267 \347\250\213\350\210\234/out/production/51\345\217\267 \347\250\213\350\210\234/lianxi1.class" new file mode 100644 index 0000000000000000000000000000000000000000..b3656de656f9ef6bc4f26a30d17b9e666e2761ee Binary files /dev/null and "b/51\345\217\267 \347\250\213\350\210\234/out/production/51\345\217\267 \347\250\213\350\210\234/lianxi1.class" differ diff --git "a/51\345\217\267 \347\250\213\350\210\234/out/production/51\345\217\267 \347\250\213\350\210\234/temp.class" "b/51\345\217\267 \347\250\213\350\210\234/out/production/51\345\217\267 \347\250\213\350\210\234/temp.class" new file mode 100644 index 0000000000000000000000000000000000000000..e9fdfb03a39d615cbfa654166b52918a30f5100a Binary files /dev/null and "b/51\345\217\267 \347\250\213\350\210\234/out/production/51\345\217\267 \347\250\213\350\210\234/temp.class" differ diff --git "a/51\345\217\267 \347\250\213\350\210\234/out/production/51\345\217\267 \347\250\213\350\210\234/text.class" "b/51\345\217\267 \347\250\213\350\210\234/out/production/51\345\217\267 \347\250\213\350\210\234/text.class" new file mode 100644 index 0000000000000000000000000000000000000000..dd9bedbe97b0bcf7f4d8de06075ecd1e687ee1c0 Binary files /dev/null and "b/51\345\217\267 \347\250\213\350\210\234/out/production/51\345\217\267 \347\250\213\350\210\234/text.class" differ diff --git "a/51\345\217\267 \347\250\213\350\210\234/out/production/51\345\217\267 \347\250\213\350\210\234/year.class" "b/51\345\217\267 \347\250\213\350\210\234/out/production/51\345\217\267 \347\250\213\350\210\234/year.class" new file mode 100644 index 0000000000000000000000000000000000000000..084f0669bf939a52ae0a684d63b1009dd5b4a127 Binary files /dev/null and "b/51\345\217\267 \347\250\213\350\210\234/out/production/51\345\217\267 \347\250\213\350\210\234/year.class" differ diff --git "a/51\345\217\267 \347\250\213\350\210\234/\347\273\203\344\271\240/.idea/.gitignore" "b/51\345\217\267 \347\250\213\350\210\234/\347\273\203\344\271\240/.idea/.gitignore" new file mode 100644 index 0000000000000000000000000000000000000000..35410cacdc5e87f985c93a96520f5e11a5c822e4 --- /dev/null +++ "b/51\345\217\267 \347\250\213\350\210\234/\347\273\203\344\271\240/.idea/.gitignore" @@ -0,0 +1,8 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml +# 基于编辑器的 HTTP 客户端请求 +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git "a/51\345\217\267 \347\250\213\350\210\234/\347\273\203\344\271\240/.idea/misc.xml" "b/51\345\217\267 \347\250\213\350\210\234/\347\273\203\344\271\240/.idea/misc.xml" new file mode 100644 index 0000000000000000000000000000000000000000..05483570e041eb648703359441d61bf9a5feeb13 --- /dev/null +++ "b/51\345\217\267 \347\250\213\350\210\234/\347\273\203\344\271\240/.idea/misc.xml" @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git "a/51\345\217\267 \347\250\213\350\210\234/\347\273\203\344\271\240/.idea/modules.xml" "b/51\345\217\267 \347\250\213\350\210\234/\347\273\203\344\271\240/.idea/modules.xml" new file mode 100644 index 0000000000000000000000000000000000000000..48ea5861da21af37059843eb67611f13dc4af2d3 --- /dev/null +++ "b/51\345\217\267 \347\250\213\350\210\234/\347\273\203\344\271\240/.idea/modules.xml" @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git "a/51\345\217\267 \347\250\213\350\210\234/\347\273\203\344\271\240/.idea/\347\273\203\344\271\240.iml" "b/51\345\217\267 \347\250\213\350\210\234/\347\273\203\344\271\240/.idea/\347\273\203\344\271\240.iml" new file mode 100644 index 0000000000000000000000000000000000000000..c90834f2d607afe55e6104d8aa2cdfffb713f688 --- /dev/null +++ "b/51\345\217\267 \347\250\213\350\210\234/\347\273\203\344\271\240/.idea/\347\273\203\344\271\240.iml" @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git "a/51\345\217\267 \347\250\213\350\210\234/\347\273\203\344\271\240/out/production/\347\273\203\344\271\240/lianxi1.class" "b/51\345\217\267 \347\250\213\350\210\234/\347\273\203\344\271\240/out/production/\347\273\203\344\271\240/lianxi1.class" new file mode 100644 index 0000000000000000000000000000000000000000..b3656de656f9ef6bc4f26a30d17b9e666e2761ee Binary files /dev/null and "b/51\345\217\267 \347\250\213\350\210\234/\347\273\203\344\271\240/out/production/\347\273\203\344\271\240/lianxi1.class" differ diff --git "a/51\345\217\267 \347\250\213\350\210\234/\347\273\203\344\271\240/src/lianxi1.java" "b/51\345\217\267 \347\250\213\350\210\234/\347\273\203\344\271\240/src/lianxi1.java" new file mode 100644 index 0000000000000000000000000000000000000000..74fc4e3a6877e7fdab245794bd36c3346d7dd983 --- /dev/null +++ "b/51\345\217\267 \347\250\213\350\210\234/\347\273\203\344\271\240/src/lianxi1.java" @@ -0,0 +1,24 @@ +import java.util.Scanner; + +public class lianxi1 { + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + System.out.println("请输入你的姓名"); + String name = sc.next(); + System.out.println("请输入你的学号"); + double studentNumber = sc.nextDouble(); + System.out.println("请输入你的性别"); + String sax = sc.next(); + System.out.println("请输入你的身高"); + double height = sc.nextInt(); + System.out.println("请输入你的体重"); + double weight = sc.nextInt(); + + System.out.println("你的姓名是:"+name); + System.out.println("你的学号是:"+studentNumber); + System.out.println("你的性别是:"+sax); + System.out.println("你的身高是:"+height); + System.out.println("你的体重是:"+weight); + + } +}