day07-常用类-ArrayList-练习3_指定格式拼接字符串
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user