Advertisement
vencinachev

Student

Nov 16th, 2020
988
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.72 KB | None | 0 0
  1.  
  2. public class Student {
  3.     private String name;
  4.     private int number;
  5.     private double grade;
  6.    
  7.     public Student(String name, int number, double grade) {
  8.         this.setName(name);
  9.         this.setNumber(number);
  10.         this.setGrade(grade);
  11.     }
  12.    
  13.     public String getName() {
  14.         return this.name;
  15.     }
  16.    
  17.     public void setName(String name) {
  18.         this.name = name;
  19.     }
  20.    
  21.     public int getNumber() {
  22.         return this.number;
  23.     }
  24.    
  25.     public void setNumber(int number) {
  26.         this.number = number;
  27.     }
  28.    
  29.     public double getGrade() {
  30.         return this.grade;
  31.     }
  32.    
  33.     public void setGrade(double grade) {
  34.         this.grade = grade;
  35.     }
  36.    
  37.     @Override
  38.     public String toString() {
  39.         return this.getName() + " " + this.getNumber() + " " + this.getGrade();
  40.     }
  41.  
  42. }
  43.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement