From ea6a04a2ef0e32d1e45b3e5a792200e2e79a496e Mon Sep 17 00:00:00 2001 From: waigo <1617731215@qq.com> Date: Thu, 4 Mar 2021 16:47:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86Student=E7=B1=BB=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Student.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Student.java b/Student.java index 815ec04..4dbcdce 100644 --- a/Student.java +++ b/Student.java @@ -2,6 +2,23 @@ public class Student { private String name; + private int age; + private int weight; + private int height; + public Student(String name, int age, int weight, int height) { + this.name = name; + this.age = age; + this.weight = weight; + this.height = height; + } + public String toString() { + return "Student{" + "name='" + name + '\'' + ", age=" + age + ", weight=" + weight + ", height=" + height + '}'; + } + + public static void main(String[] args) { + Student student = new Student("lisi",11,120,180); + System.out.println(studnet); + } } \ No newline at end of file -- Gitee