From 4e32d1fea53ef9371a5e6dc8c46f5e6aeb9b87bb Mon Sep 17 00:00:00 2001 From: SuiXxx <1752599835@qq.com> Date: Thu, 25 Jul 2024 09:08:25 +0800 Subject: [PATCH] =?UTF-8?q?7.25=E6=97=A5=E8=80=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 38 ++++++++++++++++ .idea/.gitignore | 8 ++++ .idea/encodings.xml | 8 ++++ .idea/misc.xml | 14 ++++++ pom.xml | 39 +++++++++++++++++ src/main/java/com/bwie/Main.java | 11 +++++ src/main/java/com/bwie/pojo/Stu.java | 12 ++++++ src/main/java/com/bwie/stuTest/StuText.java | 48 +++++++++++++++++++++ 8 files changed, 178 insertions(+) create mode 100644 .gitignore create mode 100644 .idea/.gitignore create mode 100644 .idea/encodings.xml create mode 100644 .idea/misc.xml create mode 100644 pom.xml create mode 100644 src/main/java/com/bwie/Main.java create mode 100644 src/main/java/com/bwie/pojo/Stu.java create mode 100644 src/main/java/com/bwie/stuTest/StuText.java diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5ff6309 --- /dev/null +++ b/.gitignore @@ -0,0 +1,38 @@ +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### IntelliJ IDEA ### +.idea/modules.xml +.idea/jarRepositories.xml +.idea/compiler.xml +.idea/libraries/ +*.iws +*.iml +*.ipr + +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store \ No newline at end of file diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.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/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..63574ec --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..132404b --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..092a080 --- /dev/null +++ b/pom.xml @@ -0,0 +1,39 @@ + + + 4.0.0 + + com.bwie + day_exam_7.25 + 1.0-SNAPSHOT + + + 8 + 8 + UTF-8 + + + + spring-boot-starter-parent + org.springframework.boot + 2.6.2 + + + + + + + + + + org.projectlombok + lombok + + + + + + + + diff --git a/src/main/java/com/bwie/Main.java b/src/main/java/com/bwie/Main.java new file mode 100644 index 0000000..f83fc80 --- /dev/null +++ b/src/main/java/com/bwie/Main.java @@ -0,0 +1,11 @@ +package com.bwie; + + + + + +public class Main { + public static void main(String[] args) { + + } +} diff --git a/src/main/java/com/bwie/pojo/Stu.java b/src/main/java/com/bwie/pojo/Stu.java new file mode 100644 index 0000000..dde32bc --- /dev/null +++ b/src/main/java/com/bwie/pojo/Stu.java @@ -0,0 +1,12 @@ +package com.bwie.pojo; + +import lombok.Data; + +@Data +public class Stu { + private String id; + private String name; + private String sex; + private String age; + private String score; +} diff --git a/src/main/java/com/bwie/stuTest/StuText.java b/src/main/java/com/bwie/stuTest/StuText.java new file mode 100644 index 0000000..f90ee6e --- /dev/null +++ b/src/main/java/com/bwie/stuTest/StuText.java @@ -0,0 +1,48 @@ +package com.bwie.stuTest; + +import com.bwie.pojo.Stu; + +import java.util.HashMap; + + +public class StuText +{ + public static void main(String[] args) { + HashMap map = new HashMap<>(); + Stu stu = new Stu(); + stu.setId("1"); + stu.setName("tom"); + stu.setSex("boy"); + stu.setAge("19"); + stu.setScore("90"); + + Stu stu2 = new Stu(); + stu2.setId("1"); + stu2.setName("rose"); + stu2.setSex("boy"); + stu2.setAge("19"); + stu2.setScore("90"); + + map.put("1",stu); + map.put("2",stu2); + System.out.println(map.get("1")); + System.out.println(map.get("2")); + + + map.forEach((s, o) -> { + System.out.println(o); + }); + + + + + } + + + + + + + + +}