Last active
June 1, 2021 03:42
-
-
Save trhgquan/4181543d332cb9949f9bd7903c601a82 to your computer and use it in GitHub Desktop.
Bài nhóm Gym chúa
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Student extends Person { | |
private String _program; | |
private int _year; | |
private double _fee; | |
public Student(String name, String program, | |
String address, int year, double fee) { | |
_name = name; | |
_address = address; | |
_program = program; | |
_year = year; | |
_fee = fee; | |
} | |
public String getProgram() { | |
return _program; | |
} | |
public void setProgram(String program) { | |
_program = program; | |
} | |
public int getYear() { | |
return _year; | |
} | |
public void setYear(int year) { | |
_year = year; | |
} | |
public double getFee() { | |
return _fee; | |
} | |
public void setFee(double fee) { | |
_fee = fee; | |
} | |
@Override | |
public String toString() { | |
StringBuilder builder = new StringBuilder(); | |
builder.append("Person{name=\'") | |
builder.append(_name); | |
builder.append("\' address=\'"); | |
builder.append(_address); | |
builder.append("\' program=\'"); | |
builder.append(_program); | |
builder.append("\' year=\'"); | |
builder.append(_year); | |
builder.append("\' fee=\'"); | |
builder.append(_fee); | |
builder.append("\'"); | |
return builder.toString(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment