day07-常用类-ArrayList-练习3_指定格式拼接字符串

This commit is contained in:
2026-07-21 15:46:22 +08:00
parent f59481bb65
commit 36f64d3cd9
3 changed files with 92 additions and 0 deletions
@@ -0,0 +1,20 @@
package com.inmind.arraylist03;
public class Student {
String name;
int age;
String gender;
public Student() {
}
public Student(String name, int age, String gender) {
this.name = name;
this.age = age;
this.gender = gender;
}
public void showSelf(){
System.out.println("当前学生叫"+this.name+",年龄"+this.age+"岁,性别为"+this.gender);
}
}