From 777d9831d17d8bc98e594bba504c4b20837bde0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BC=80=E7=A4=BE?= <2568429394@qq.com> Date: Thu, 18 Apr 2024 02:53:02 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20?= =?UTF-8?q?=E6=9D=8E=E5=B0=91=E8=BD=A9=20=E8=BD=AF=E4=BB=B62=E7=8F=AD/.ide?= =?UTF-8?q?a/=E6=9D=8E=E5=B0=91=E8=BD=A9=20=E8=BD=AF=E4=BB=B62=E7=8F=AD.im?= =?UTF-8?q?l?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...275\251 \350\275\257\344\273\2662\347\217\255.iml" | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 "\346\235\216\345\260\221\350\275\251 \350\275\257\344\273\2662\347\217\255/.idea/\346\235\216\345\260\221\350\275\251 \350\275\257\344\273\2662\347\217\255.iml" diff --git "a/\346\235\216\345\260\221\350\275\251 \350\275\257\344\273\2662\347\217\255/.idea/\346\235\216\345\260\221\350\275\251 \350\275\257\344\273\2662\347\217\255.iml" "b/\346\235\216\345\260\221\350\275\251 \350\275\257\344\273\2662\347\217\255/.idea/\346\235\216\345\260\221\350\275\251 \350\275\257\344\273\2662\347\217\255.iml" deleted file mode 100644 index 1de981c..0000000 --- "a/\346\235\216\345\260\221\350\275\251 \350\275\257\344\273\2662\347\217\255/.idea/\346\235\216\345\260\221\350\275\251 \350\275\257\344\273\2662\347\217\255.iml" +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file -- Gitee From 20d32bef8a75b7bc8a985fb2942ed2900d26a71b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BC=80=E7=A4=BE?= <2568429394@qq.com> Date: Thu, 18 Apr 2024 20:28:59 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat=EF=BC=9A=E6=8F=90=E4=BA=A4=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Main.java" | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 "work/com/java/minxi/java_20240418/java_2302_\347\216\213\345\274\200\347\244\276_2344310220/Main.java" diff --git "a/work/com/java/minxi/java_20240418/java_2302_\347\216\213\345\274\200\347\244\276_2344310220/Main.java" "b/work/com/java/minxi/java_20240418/java_2302_\347\216\213\345\274\200\347\244\276_2344310220/Main.java" new file mode 100644 index 0000000..1247efe --- /dev/null +++ "b/work/com/java/minxi/java_20240418/java_2302_\347\216\213\345\274\200\347\244\276_2344310220/Main.java" @@ -0,0 +1,75 @@ +package com.java.minxi.java_20240418.java_2302_王开社_2344310220; + +/** 1.按照Java相关规范编写代码(必须包含.java文件,文件里面包含包名、类名、变量名、方法名) + + 2.使用idea提交代码至仓库(需先配置好git) + + 3.未按照要求提交的,本次作业0分计算,需重新修改后提交,检查合格后再评分; + + + + 题目: + + 1.创建学生类,类中包含编号、姓名、年龄、性别变量,包含跑步、吃饭、睡觉的方法; + + 2.新建main函数,创建3个学生对象; + + 3.通过各个学生对象给其变量赋值,相关值如下: + + 对象1:编号:1,姓名:张三,年龄:21,性别:男 + + 对象2:编号:2,姓名:李四,年龄:25,性别:男 + + 对象3:编号:3,姓名:王丽,年龄:19,性别:女 + + 4.使用相关对象方法,分别用代码实现,“李四正在跑步”,“张三正在吃饭”,“王丽正在睡觉”; + + **/ + +//创建类class Student{ +class Student{ + int id; + String name; + double age; + String sex; + String run; + String eat; + String sleep; + + public Student(int id,String name,int age,String sex){ + this.id=id; + this.name = name; + this.age = age; + this.sex = sex; + } + public void a(int id){ + + if (id == 1){ + System.out.println("李四正在跑步"); + + } else if (id==2) { + System.out.println("张三正在吃饭"); + + }else { + System.out.println("王丽正在睡觉"); + } + } + +} +public class Main { +// 对象1:编号:1,姓名:张三,年龄:21,性别:男 +// +// 对象2:编号:2,姓名:李四,年龄:25,性别:男 +// +// 对象3:编号:3,姓名:王丽,年龄:19,性别:女 + public static void main(String[] args) { + //创建对象 + Student zs = new Student(1,"张三",21,"男"); + Student ls = new Student(2,"李四",25,"男"); + Student wl = new Student(3,"王丽",19,"女"); + zs.a(1); + ls.a(2); + wl.a(3); + + } +} \ No newline at end of file -- Gitee