Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1. public class StudentController {
  2.    private Student model;
  3.    private StudentView view;
  4.  
  5.    public StudentController(Student model, StudentView view){
  6.       this.model = model;
  7.       this.view = view;
  8.    }
  9.  
  10.    public void setStudentName(String name){
  11.       model.setName(name);     
  12.    }
  13.  
  14.    public String getStudentName(){
  15.       return model.getName();      
  16.    }
  17.  
  18.    public void setStudentRollNo(String rollNo){
  19.       model.setRollNo(rollNo);     
  20.    }
  21.  
  22.    public String getStudentRollNo(){
  23.       return model.getRollNo();    
  24.    }
  25.  
  26.    public void updateView(){               
  27.       view.printStudentDetails(model.getName(), model.getRollNo());
  28.    }   
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement