السلام عليكــم ورحمـة الله وبركاتــه
انا عندي مشكلة في الكود ويوم سألت عنها واحد قالي المشكلة في الـ constructor لأنها مش محتوية على اربع متغيرات فعدلتها لكن المشكلة لازالت موجودة
هذا كود الكلاس الي استخدم فيه الـ constructor
package controller;
import java.util.ArrayList;
import java.util.List;
import model.Employee;
import model.Faculty;
import model.Staff;
public class EmployeesBean {
private List<Employee> employeesList=new ArrayList<Employee>();
public List<Employee> getEmployeesList(){
employeesList.add(new Faculty("Sayed", 5000, "Lecturer","Engineering"));
employeesList.add(new Faculty("Rawan", 7000, "Prof.","Law"));
employeesList.add(new Faculty("Razan", 9000, "TA","Science"));
employeesList.add(new Staff("Hassan", 5000, "Clerk","Admin"));
employeesList.add(new Staff("Saeed", 5000, "HelpDesk","Library"));
employeesList.add(new Staff("Tarik", 5000, "Manager","HR"));
return employeesList;
}
}وهذا كود الـ constructor
public Faculty(String name,double salary,String college, String rank) {
super();
setSalary(salary);
setName(name);
this.college = college;
this.rank = rank;
}
public Faculty() {
super();
setSalary(0.0);
setName(null);
this.college = null;
this.rank = null;
}الـ salary والـ name مأخوذين من كلاس اخر علشان كذا قاعد استخدم الفنكشن set
ارجوا منكم المساعدة العاجلة :huh:
وشكراً جزيلاً :wub:
