Mvc Program
Mvc Program
// Main class
controller.updateView();
controller.setEmployeeName("Bhopal");
controller.updateView();
employee.setName("VIT");
employee.setId("112");
employee.setDepartment("SCSE");
return employee;
// Model Class
class Employee {
return name;
this.name = name;
return id;
this.id = id;
return department;
}
public void setDepartment(String department) {
this.department = department;
// View Class
class EmployeeView {
System.out.println("Employee Details:");
// Controller Class
class EmployeeController {
this.model = model;
this.view = view;
model.setName(name);
}
return model.getName();
model.setId(id);
return model.getId();
model.setDepartment(department);
return model.getDepartment();
view.printEmployeeDetails(model.getName(), model.getId(),
model.getDepartment());
OUTPUT: