Blogs of oops

We are a web development and outsourcing agency based in Kochi, India.

Simple explanation of abstract classes and why we would use them

Lets consider an example. We are creating 2 classes for employees in an office. There are 2 kinds of employees, fulltime and contract employees. Both type of employees have some common methods and properties like, name, monthly salary etc.class EmployeeFulltime {   public $fistName  = '';   public $lastName  = '';   public $annualPay = 0;      public function __construct($employee)   {    $this->firstName = $employee['firstName'];    $this->lastName  = $employee['lastName'];    $this->annualPay = $employee['annualPay'];   }   public function getFullName()   {    return $this->firstName . " " . $this->lastName;   }   public function g...

2hats Logic HelpBot