<?php
class Employee{
private$name;
private$dept;
private$position;
private$salary;
//Constructor Method
public function Employee($name,$dept,$position,$salary){
$this->name=$name;
$this->dept=$dept;
$this->position=$position;
$this->salary=$salary;
}
// Setter and Getter Methods
public function setName($name){
$this->name=$name;
}
public function getName(){
return $this->name;
}
public function setDept($dept){
$this->name=$dept;
}
public function getDept(){
return $this->dept;
}
public function setPosition($position){
$this->name=$position;
}
public function getPosition(){
return $this->position;
}
public function setSalary($salary){
$this->name=$salary;
}
public function getSalary(){
return $this->salary;
}
}//end class
?>
-----------------OUTPUT--------------
Name : Faruk Hossain Topu
Department : IT
Position : Web-Developer
Salary : $2000
Name : Ratul
Department : IT
Position : Web-Designer
Salary : $1500
Name : Sajid
Department : IT
Position : Web-Designer
Salary : $1500
/1
Comments 4
good
Awesome Work Bro..
Dost tomare ami amar function e ..................banaisi..............
Comments 4