guyanqing 1 year ago
parent
commit
10696a4a33

+ 19 - 1
pom.xml

@@ -22,9 +22,27 @@
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
-      <version>4.11</version>
+      <version>4.12</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.12</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.testng</groupId>
+      <artifactId>testng</artifactId>
+      <version>7.8.0</version>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.13.2</version>
+      <scope>compile</scope>
+    </dependency>
   </dependencies>
 
   <build>

+ 2 - 0
src/main/java/com/sf/day01/Test.java

@@ -8,5 +8,7 @@ public class Test {
     public static void main(String[] args){
         System.out.println("Hello");
         System.out.println("Hello Students");
+        System.out.print("Hello Students");
+        System.out.print("Hello Students");
     }
 }

+ 53 - 0
src/main/java/com/sf/day02/Test.java

@@ -0,0 +1,53 @@
+package com.sf.day02;
+
+public class Test {
+    public static void main(String[] args) {
+        System.out.println("Hello");
+        System.out.println("Hello Students");
+        System.out.print("Hello Students");
+        System.out.print("Hello Students");
+        //  单行注释     通常放在当行代码上面  对当前的代码进行解释
+        /*
+           多行注释  放在方法上面或者代码上面
+         */
+
+        /**
+         * 文档注释  文本注释
+         * 在类上面或者方法上面
+         * 支持一些注解   对代码作者信息进行描述的注解
+         * @author  guyanqing
+         * @createTime  2023/6/1
+         * @apiNote api文档
+         * @param 解释方法里的参数
+         *  注意事项:注释之间不能进行嵌套  (单行注释除外)
+         */
+        //////
+        /*
+        /*
+         */
+        /**
+         * /**
+         * */
+
+    }
+
+    /**
+     * 这个方法是获取用户的方法
+     * @param name   用户名称
+     * @param age     用户的年龄
+     */
+    public void getUser(String name  , int age){
+
+    }
+
+    int num = 10;
+    int NUM = 10;
+    String studentName = "zs";
+
+    int a = 10;
+    int studentAge = 10;
+
+
+
+
+}

+ 106 - 0
src/main/java/com/sf/day02/Test1.java

@@ -0,0 +1,106 @@
+package com.sf.day02;
+
+import java.util.Scanner;
+
+public class Test1 {
+    public static final String IP_ADDRESS = "47.96.190.116";
+
+    public static void main(String[] args) {
+        //常量
+        String studentName = "zs";
+        int num = 1;
+        num = 2;
+//        System.out.println(num);
+
+        /**
+         * 变量的分类(数据类型)  :
+         * 基本数据类型:
+         *      整型   int
+         *          byte short int long
+         *          作用:根据字节不同 在内存中所占有的空间不同
+         *      字节  1    2     4    8
+         *      计算机的最小单元是位 bit   1字节 = 8位
+         *            -128-127     .....
+         *
+         *      浮点型    float  double     小数  默认 double
+         *                4       8
+         *                单精度   双精度         区别  有效位的权威性
+         *
+         *      字符    char   '2'  通常
+         *              char  a = ’A‘;
+         *           字符和整型之间的运算   ’A‘+3
+         *       ASCII   A  = 65 A-Z    a = 97  a-z  以此类推 +1
+         *
+         *      布尔    boolean    真假 非真即假     true   false
+         *       boolean  aa = true/false;   条件判断语句
+         *
+         * 引用数据类型:
+         *     三种:类   接口  数组   (String)
+         *
+         *
+         * 变量的分类   (按声明的位置分)
+         * 类内(方法外)   方法内
+         *
+         * 实例变量  (不用static修饰的变量)  类变量(静态变量)  static
+         *
+         * 声明  初始化    显示初始化
+         * int  a ;       int a = 1;
+         * a = 1;
+         *
+         * 包装类: byte  short  int  long
+         * int    Integer  byte  Byte  short Short   long  Long
+         * char   Character
+         *
+         * 基本数据类型 和 包装类  区别   装箱   --  拆箱
+         * int  a  = 0:  integer  --  null
+         */
+
+        int aaa = 10;
+        Integer bbb = 10;  //ctrl +  鼠标左键
+        char aa  = 'a';
+        int bb = aa+3;   //  bb = 68  D    'A'  = 65  a  = 97
+        System.out.println( bb);
+        byte a  = (byte) 1000;
+        short b = 1000;
+        int c = 10000;
+        long d =100000L;  //l/L
+//        System.out.println(a);
+        float e = 10.10F;  //F/f
+        double f = 10.10D;  //D/d   (可选)
+        float g = (float) 10.10;
+        short s = 3;   //初始化
+         s= (short) (s+2);
+         s+=2;     //s  =s+2;
+
+        /**
+         * 键盘输入
+         * if语句
+         * if(){
+         *
+         * }else if(){
+         *
+         * }
+         */
+        Scanner scanner = new Scanner(System.in);
+//        String next = scanner.next();
+//        System.out.println(next);
+//        int nextInt = scanner.nextInt();
+//        System.out.println(nextInt);
+//        boolean b1 = scanner.nextBoolean();
+//        System.out.println(b1);
+        char c1 = scanner.next().charAt(1);
+        System.out.println(c1);
+
+        /**
+         * 随机数
+         */
+        double random = Math.random();  //[0,1)
+        //INT   [0,99]
+        int random1 = (int) Math.random();
+    }
+
+    @org.junit.Test
+    public void t1(){
+        System.out.println("--");
+    }
+}

BIN
target/classes/com/sf/day01/Test.class


BIN
target/classes/com/sf/day02/Test.class


BIN
target/classes/com/sf/day02/Test1.class