Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.64 KB | None | 0 0
  1. package scr2;
  2.  
  3. public class Student {
  4.         private String names;
  5.         private int clas;
  6.         private String specialty;
  7.         private String university;
  8.         private String email;
  9.         private String phone;
  10.         private static int counter = 0;
  11.  
  12.         public String getNames() {
  13.             return names;
  14.         }
  15.  
  16.         public void setNames(String names) {
  17.             this.names = names;
  18.         }
  19.  
  20.         public int getClas() {
  21.             return clas;
  22.         }
  23.  
  24.         public void setClas(int clas) {
  25.             this.clas = clas;
  26.         }
  27.  
  28.         public String getSpecialty() {
  29.             return specialty;
  30.         }
  31.  
  32.         public void setSpecialty(String specialty) {
  33.             this.specialty = specialty;
  34.         }
  35.  
  36.         public String getUniversity() {
  37.             return university;
  38.         }
  39.  
  40.         public void setUniversity(String university) {
  41.             this.university = university;
  42.         }
  43.  
  44.         public String getEmail() {
  45.             return email;
  46.         }
  47.  
  48.         public void setEmail(String email) {
  49.             this.email = email;
  50.         }
  51.  
  52.         public String getPhone() {
  53.             return phone;
  54.         }
  55.  
  56.         public void setPhone(String phone) {
  57.             this.phone = phone;
  58.         }
  59.  
  60.         public static int getCounter() {
  61.             return counter;
  62.         }
  63.  
  64.         public static void setCounter(int counter) {
  65.             Student.counter = counter;
  66.         }
  67.  
  68.         public Student(String names, int clas, String specialty, String university, String email, String phone) {
  69.  
  70.             this.names = names;
  71.             this.clas = clas;
  72.             this.specialty = specialty;
  73.             this.university = university;
  74.             this.email = email;
  75.             this.phone = phone;
  76.             counter++;
  77.  
  78.         }
  79.         public Student() {
  80.  
  81.             this.names = null;
  82.             this.clas = 0;
  83.             this.specialty = null;
  84.             this.university = null;
  85.             this.email = null;
  86.             this.phone = null;
  87.             counter++;
  88.  
  89.         }
  90.         public Student(String names){
  91.             counter++;
  92.              this.names=names;
  93.  
  94.  
  95.         }
  96.  
  97.         public static void printcounter() {
  98.             System.out.println(counter);
  99.  
  100.         }
  101.  
  102.         public void printparameters(){
  103.             System.out.println(this.names);
  104.             System.out.println(this.clas);
  105.             System.out.println(this.specialty);
  106.             System.out.println(this.university);
  107.             System.out.println(this.email);
  108.             System.out.println(this.phone);
  109.         }
  110.  
  111.  
  112.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement