Advertisement
sergAccount

Untitled

Aug 23rd, 2020
955
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.17 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package com.spec.model;
  7.  
  8. public class Student {
  9.     // имя
  10.     private String name;
  11.     // возраст
  12.     private int age;
  13.     // переменная с модификатором static
  14.     private int instituteCode;
  15.    
  16.     // конструктор класса - без параметров
  17. //    public Student() {
  18. //        
  19. //    }    
  20.     // конструктор класса
  21.     public Student(String name, int age) {
  22.         this.name = name;
  23.         this.age = age;
  24.     }    
  25.  
  26.     // Alt+Insert    
  27.     public String getName() {
  28.         return name;
  29.     }
  30.  
  31.     public void setName(String name) {
  32.         this.name = name;
  33.     }
  34.  
  35.     public int getAge() {
  36.         return age;
  37.     }
  38.  
  39.     public void setAge(int age) {
  40.         this.age = age;
  41.     }
  42.  
  43.     public int getInstituteCode() {        
  44.         return instituteCode;
  45.     }
  46.  
  47.     public void setInstituteCode(int instituteCode) {
  48.         this.instituteCode = instituteCode;
  49.     }    
  50. }
  51.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement