Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Student {
- private String name;
- private int number;
- private double grade;
- public Student(String name, int number, double grade) {
- this.setName(name);
- this.setNumber(number);
- this.setGrade(grade);
- }
- public String getName() {
- return this.name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public int getNumber() {
- return this.number;
- }
- public void setNumber(int number) {
- this.number = number;
- }
- public double getGrade() {
- return this.grade;
- }
- public void setGrade(double grade) {
- this.grade = grade;
- }
- @Override
- public String toString() {
- return this.getName() + " " + this.getNumber() + " " + this.getGrade();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement