Advertisement
sergAccount

Untitled

Aug 23rd, 2020
1,017
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.07 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 static int instituteCode;
  15.    
  16.     // конструктор класса
  17.     public Student(String name, int age) {
  18.         this.name = name;
  19.         this.age = age;
  20.     }    
  21.  
  22.     // Alt+Insert    
  23.     public String getName() {
  24.         return name;
  25.     }
  26.  
  27.     public void setName(String name) {
  28.         this.name = name;
  29.     }
  30.  
  31.     public int getAge() {
  32.         return age;
  33.     }
  34.  
  35.     public void setAge(int age) {
  36.         this.age = age;
  37.     }
  38.  
  39.     public static int getInstituteCode() {        
  40.         return instituteCode;
  41.     }
  42.  
  43.     public static void setInstituteCode(int instituteCode) {
  44.         Student.instituteCode = instituteCode;
  45.     }    
  46. }
  47.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement