Advertisement
Swampert420

Student

Aug 14th, 2022 (edited)
696
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.59 KB | Source Code | 0 0
  1. package pack3;
  2.  
  3. import pack1.Teacher;
  4.  
  5. public class Student extends Teacher {
  6.     int id;
  7.     public Student(int s_id, int t_id, int sub_id){
  8.         super(t_id, sub_id);
  9.         this.id = s_id;
  10.     }
  11.    
  12.     public void setSubjectId(int sub_id){
  13.         super.subjectId = sub_id;
  14.     }
  15.     public int getSubjectId(){
  16.         return super.subjectId;
  17.     }
  18.    
  19.     protected void setTeacherId(int t_id){
  20.         super.teacherId = t_id;
  21.     }
  22.     protected int getTeacherId(){
  23.         return super.teacherId;
  24.     }
  25.    
  26.     public int getId(){
  27.         return id;
  28.     }
  29. }
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement