commit d1a4bddc45fa516bc554f19d45a294abe0142f61 Author: bai <173792339@qq.com> Date: Thu Jul 25 09:15:37 2024 +0800 ria_07 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..35410ca --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml +# 基于编辑器的 HTTP 客户端请求 +/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..aa00ffa --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,7 @@ + + + + + + + \ 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/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 0000000..2b63946 --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..d7d8815 --- /dev/null +++ b/pom.xml @@ -0,0 +1,17 @@ + + + 4.0.0 + + com.bwie + ria_07 + 1.0-SNAPSHOT + + + 8 + 8 + UTF-8 + + + diff --git a/src/main/java/com/bwie/Main.java b/src/main/java/com/bwie/Main.java new file mode 100644 index 0000000..2d5af9c --- /dev/null +++ b/src/main/java/com/bwie/Main.java @@ -0,0 +1,37 @@ +package com.bwie; + +import java.util.HashMap; +import java.util.Set; + +public class Main { + public static void main(String[] args) { +// 创建HashMap对象 + HashMap map = new HashMap<>(); + Student stu1 = new Student( 1, "AAA", "男", 100 ); + Student stu2 = new Student( 2, "BBB", "女", 98 ); + map.put( "1",stu1 ); + map.put( "2",stu2 ); + //1 + Set strings = map.keySet(); + for (String s : strings) { + Student sutdent = map.get( s ); + System.out.println(sutdent); + } + //2 + System.out.println(2222222); + int size = map.size(); + for (int i = 1; i < size; i++) { + Student sutdent = map.get( "1" ); + Student sutdent2 = map.get( "2"); + System.out.println(sutdent); + System.out.println(sutdent2); + + } + //3 + System.out.println(333333333); + for (Student value : map.values()) { + System.out.println(value); + } + + } +} diff --git a/src/main/java/com/bwie/Student.java b/src/main/java/com/bwie/Student.java new file mode 100644 index 0000000..1b47b32 --- /dev/null +++ b/src/main/java/com/bwie/Student.java @@ -0,0 +1,60 @@ +package com.bwie; + +public class Student { + private Integer stuId; + private String stuName; + private String stuSex; + private Integer stuScore; + + public Student(Integer stuId, String stuName, String stuSex, Integer stuScore) { + this.stuId = stuId; + this.stuName = stuName; + this.stuSex = stuSex; + this.stuScore = stuScore; + } + + public Student() { + } + + @Override + public String toString() { + return "Student{" + + "stuId=" + stuId + + ", stuName='" + stuName + '\'' + + ", stuSex='" + stuSex + '\'' + + ", stuScore=" + stuScore + + '}'; + } + + public Integer getStuId() { + return stuId; + } + + public void setStuId(Integer stuId) { + this.stuId = stuId; + } + + public String getStuName() { + return stuName; + } + + public void setStuName(String stuName) { + this.stuName = stuName; + } + + public String getStuSex() { + return stuSex; + } + + public void setStuSex(String stuSex) { + this.stuSex = stuSex; + } + + public Integer getStuScore() { + return stuScore; + } + + public void setStuScore(Integer stuScore) { + this.stuScore = stuScore; + } +}