commit fd230339bd89a9855376126a83497dcba9fec660 Author: syx_computer Date: Tue Sep 30 13:20:26 2025 +0800 Initial commit diff --git a/hello.java b/hello.java new file mode 100644 index 0000000..acabd66 --- /dev/null +++ b/hello.java @@ -0,0 +1,6 @@ +public class hello { + + public static void main(String[] args) { + System.out.println("helloworld"); + } +} \ No newline at end of file diff --git a/test-2048/.gitignore b/test-2048/.gitignore new file mode 100644 index 0000000..f68d109 --- /dev/null +++ b/test-2048/.gitignore @@ -0,0 +1,29 @@ +### IntelliJ IDEA ### +out/ +!**/src/main/**/out/ +!**/src/test/**/out/ + +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache +bin/ +!**/src/main/**/bin/ +!**/src/test/**/bin/ + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store \ No newline at end of file diff --git a/test-2048/.idea/.gitignore b/test-2048/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/test-2048/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/test-2048/.idea/misc.xml b/test-2048/.idea/misc.xml new file mode 100644 index 0000000..0548357 --- /dev/null +++ b/test-2048/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/test-2048/.idea/modules.xml b/test-2048/.idea/modules.xml new file mode 100644 index 0000000..8842417 --- /dev/null +++ b/test-2048/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/test-2048/src/Main.java b/test-2048/src/Main.java new file mode 100644 index 0000000..ff2267a --- /dev/null +++ b/test-2048/src/Main.java @@ -0,0 +1,10 @@ +import javax.swing.*; + +public class Main { + public static void main(String[] args) { + StudentTool studentTool = new StudentTool(); + Student student = studentTool.getStudent(); + //student.getName(); + System.out.println(student.getName() + "---" + student.getAge()); + } +} \ No newline at end of file diff --git a/test-2048/src/Student.java b/test-2048/src/Student.java new file mode 100644 index 0000000..57f9cd6 --- /dev/null +++ b/test-2048/src/Student.java @@ -0,0 +1,23 @@ +public class Student { + private String name; + private int age; + public String getName(){ + return name; + } + public int getAge(){ + return age; + } + public void setName(String name){ + this.name = name; + } + public void setAge(int age){ + this.age = age; + } + public Student(){ + + } + public Student(String name, int age){ + this.name = name; + this.age = age; + } +} diff --git a/test-2048/src/StudentTool.java b/test-2048/src/StudentTool.java new file mode 100644 index 0000000..6c29633 --- /dev/null +++ b/test-2048/src/StudentTool.java @@ -0,0 +1,13 @@ +import java.util.Scanner; + +public class StudentTool { + public Student getStudent(){ + Scanner scanner = new Scanner(System.in); + System.out.println("输入姓名"); + String name = scanner.next(); + System.out.println("输入年龄"); + int age = scanner.nextInt(); + Student student = new Student(name, age); + return student; + } +} diff --git a/test-2048/src/mode1/Demo1.java b/test-2048/src/mode1/Demo1.java new file mode 100644 index 0000000..86ccd02 --- /dev/null +++ b/test-2048/src/mode1/Demo1.java @@ -0,0 +1,15 @@ +package mode1; + +import java.util.Random; + +public class Demo1 { + public static void main(String[] args) { + Random random = new Random(); + int num = random.nextInt(10); + + System.out.println(num); + + } + + +} diff --git a/test-2048/test-2048.iml b/test-2048/test-2048.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/test-2048/test-2048.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/test-idea/.gitignore b/test-idea/.gitignore new file mode 100644 index 0000000..f68d109 --- /dev/null +++ b/test-idea/.gitignore @@ -0,0 +1,29 @@ +### IntelliJ IDEA ### +out/ +!**/src/main/**/out/ +!**/src/test/**/out/ + +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache +bin/ +!**/src/main/**/bin/ +!**/src/test/**/bin/ + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store \ No newline at end of file diff --git a/test-idea/.idea/.gitignore b/test-idea/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/test-idea/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/test-idea/.idea/misc.xml b/test-idea/.idea/misc.xml new file mode 100644 index 0000000..1f014b5 --- /dev/null +++ b/test-idea/.idea/misc.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/test-idea/.idea/modules.xml b/test-idea/.idea/modules.xml new file mode 100644 index 0000000..cca91f4 --- /dev/null +++ b/test-idea/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/test-idea/src/Demo1Constant.java b/test-idea/src/Demo1Constant.java new file mode 100644 index 0000000..b319ab3 --- /dev/null +++ b/test-idea/src/Demo1Constant.java @@ -0,0 +1,9 @@ +public class Demo1Constant { + public static void main(String[] args) { + System.out.println(true); + System.out.println("nihao"); + System.out.println('a'); + System.out.println(1); + System.out.println(10 > 20); + } +} diff --git a/test-idea/src/Main.java b/test-idea/src/Main.java new file mode 100644 index 0000000..27f3545 --- /dev/null +++ b/test-idea/src/Main.java @@ -0,0 +1,7 @@ +public class Main { + public static void main(String[] args) { + //TODO:nihao + //TODO: + System.out.println("Hello world!"); + } +} \ No newline at end of file diff --git a/test-idea/src/input.java b/test-idea/src/input.java new file mode 100644 index 0000000..8eb5ca5 --- /dev/null +++ b/test-idea/src/input.java @@ -0,0 +1,14 @@ +import java.util.Scanner; + +public class input { + public static void main(String[] args) { + Scanner scanner = new Scanner(System.in); + System.out.print("你的名字:"); + String name = scanner.next(); + System.out.print("你的年龄:"); + int a = scanner.nextInt(); + System.out.println("你的名字是"+name+" 你的年龄是"+a); + } + + +} diff --git a/test-idea/test-idea.iml b/test-idea/test-idea.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/test-idea/test-idea.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file