From 8611d8a0ab518a6f633c8c262e31c2f3bf6907e4 Mon Sep 17 00:00:00 2001 From: lwj <3529558005@qq.com> Date: Thu, 8 Aug 2024 08:59:28 +0800 Subject: [PATCH] riako8_8 --- .gitignore | 38 +++++++++++ .idea/$PROJECT_FILE$ | 11 ++++ .idea/.gitignore | 8 +++ .idea/encodings.xml | 8 +++ .idea/misc.xml | 19 ++++++ .idea/qaplug_profiles.xml | 12 ++++ .idea/vcs.xml | 6 ++ pom.xml | 17 +++++ src/main/java/com/bwie/Main.java | 75 ++++++++++++++++++++++ src/main/java/com/bwie/domain/Student.java | 60 +++++++++++++++++ 10 files changed, 254 insertions(+) create mode 100644 .gitignore create mode 100644 .idea/$PROJECT_FILE$ create mode 100644 .idea/.gitignore create mode 100644 .idea/encodings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/qaplug_profiles.xml create mode 100644 .idea/vcs.xml create mode 100644 pom.xml create mode 100644 src/main/java/com/bwie/Main.java create mode 100644 src/main/java/com/bwie/domain/Student.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/$PROJECT_FILE$ b/.idea/$PROJECT_FILE$ new file mode 100644 index 0000000..58b7e3e --- /dev/null +++ b/.idea/$PROJECT_FILE$ @@ -0,0 +1,11 @@ + + + + + + + \ 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..65ac0a6 --- /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..b6463d8 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/qaplug_profiles.xml b/.idea/qaplug_profiles.xml new file mode 100644 index 0000000..9a7566c --- /dev/null +++ b/.idea/qaplug_profiles.xml @@ -0,0 +1,12 @@ + + + + + \ 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..03c7dd2 --- /dev/null +++ b/pom.xml @@ -0,0 +1,17 @@ + + + 4.0.0 + + com.bwie + rikao8_8 + 1.0-SNAPSHOT + + + 17 + 17 + 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..d9a4ff5 --- /dev/null +++ b/src/main/java/com/bwie/Main.java @@ -0,0 +1,75 @@ +package com.bwie; + +import com.bwie.domain.Student; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Stream; + +//TIP 要运行代码,请按 或 +// 点击装订区域中的 图标。 +public class Main { + public static void main(String[] args) { + //存入实体类中 + //第一个 + Student student = new Student(); + student.setStudentId(1); + student.setStudentName("黑鬼"); + student.setScore(30); + student.setClassName("语文"); + + String string=student.toString(); + + + + //第二个 + Student student1= new Student(); + student1.setStudentId(1); + student1.setStudentName("黑黑"); + student1.setScore(30); + student1.setClassName("英语"); + String string1=student1.toString(); + +//第三个 + Student student2= new Student(); + student2.setStudentId(1); + student2.setStudentName("黑黑"); + student2.setScore(30); + student2.setClassName("数学"); + String string2=student2.toString(); + + +//第四个 + Student student3= new Student(); + student3.setStudentId(1); + student3.setStudentName("黑黑"); + student3.setScore(30); + student3.setClassName("政治"); + String string3=student3.toString(); + + +//第五个 + Student student4= new Student(); + student4.setStudentId(1); + student4.setStudentName("黑黑"); + student4.setScore(30); + student4.setClassName("英语"); + String string4=student4.toString(); + + + //都存入到集合中 + List stringList=new ArrayList<>(); + stringList.add(string); + stringList.add(string1); + stringList.add(string2); + stringList.add(string3); + stringList.add(string4); + + + Stream distinct = stringList. + stream().distinct(); + System.out.println(distinct); + + + } +} diff --git a/src/main/java/com/bwie/domain/Student.java b/src/main/java/com/bwie/domain/Student.java new file mode 100644 index 0000000..f7603fd --- /dev/null +++ b/src/main/java/com/bwie/domain/Student.java @@ -0,0 +1,60 @@ +package com.bwie.domain; + +public class Student { + private Integer studentId; + private String studentName; + private String className; + private Integer score; + + public Student(Integer studentId, String studentName, String className, Integer score) { + this.studentId = studentId; + this.studentName = studentName; + this.className = className; + this.score = score; + } + + public Student() { + } + + public Integer getStudentId() { + return studentId; + } + + public void setStudentId(Integer studentId) { + this.studentId = studentId; + } + + public String getStudentName() { + return studentName; + } + + public void setStudentName(String studentName) { + this.studentName = studentName; + } + + public String getClassName() { + return className; + } + + public void setClassName(String className) { + this.className = className; + } + + public Integer getScore() { + return score; + } + + public void setScore(Integer score) { + this.score = score; + } + + @Override + public String toString() { + return "Student{" + + "," + studentId + + ",'" + studentName + '\'' + + "," + className + '\'' + + "," + score + + '}'; + } +}