guyanqing hai 1 ano
pai
achega
9cb91f7b97

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

@@ -1,15 +1,10 @@
 package com.sf.day02;
 
-
-import javax.swing.text.MaskFormatter;
 import java.util.Scanner;
 
 public class Test {
     static int age = 18;
 
-
-
-
     /*
     获取用户的方法
     方法名:getInfo

+ 34 - 0
src/main/java/com/sf/day05_2/Test.java

@@ -0,0 +1,34 @@
+package com.sf.day05_2;
+
+import javafx.beans.binding.When;
+
+/**
+ * @createTime  2024/04/28
+ * 补课
+ */
+public class Test {
+    static int b =2;
+    static boolean flag = true;
+    boolean flag2 = false;
+
+
+
+//程序启动的入口
+    public static void main(String[] args) {
+        int a =1;
+        System.out.println("Hello");
+        System.out.println(b);
+        String str = "admin";
+        while (flag){
+        if(a==1){
+            flag = false;
+        }
+        }
+    }
+
+
+    @org.junit.Test
+    public void t1(){
+
+    }
+}

+ 59 - 0
src/main/java/com/sf/day05_3/Test.java

@@ -0,0 +1,59 @@
+package com.sf.day05_3;
+
+public class Test {
+
+    static int number = 100;
+
+
+    /**
+     *  静态方法   : 必须调用静态变量
+     * 实例方法:可以调用静态变量和实例变量
+     */
+    //  静态方法
+    public static void main(String[] args) {
+        int num = 101;
+        System.out.println(number);
+        System.out.println(num);
+    }
+
+
+    //  实例方法
+    @org.junit.Test
+    public void t1(){
+        //  什么是声明 什么是初始化
+        int a = 0;  //声明
+        int b = 1;  //初始化
+        System.out.println(b);
+
+        boolean flag = true;//真
+        boolean flag2 = false;//假
+       // boolean flag3 = 0;//假  不成立
+
+        System.out.println(number);
+//        System.out.println(num);
+    }
+
+    @org.junit.Test
+    public void t2(){
+//        int a = 20;
+//        long b =200;
+//        short c = 200;
+//        byte d = (byte) 1234;
+
+        char a = 'a';
+        int b = a+1;  // 'a' + 1
+        System.out.println(a);
+        System.out.println((char) b);
+        }
+
+
+        @org.junit.Test
+        public void t4(){
+        //三目运算符
+            //(a>b)?a:b
+            int a = 4;
+            int b  = 5;
+           int max =  (a>b)?a:b;
+            System.out.println(max);
+        }
+}

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


BIN=BIN
target/classes/com/sf/day05/Array.class


BIN=BIN
target/classes/com/sf/day05_2/Test.class


BIN=BIN
target/classes/com/sf/day05_3/Test.class