Switch to full style
:read: Start PHP with us. Includes topics to help you in php
Post a reply

Implement an interface in php

Sun Oct 26, 2008 11:57 pm

Code:
<?php
interface Chargeable
{
    
public function getPrice();
}

class
Employee implements Chargeable {
    
protected $price;

    
public function getPrice() {
        return
$this->price;
    }
}

$product = new Employee();

?>




Post a reply
  Related Posts  to : Implement an interface in php
 how to implement an interface     -  
 How to implement HttpSessionListener in JSP     -  
 How to implement serialization using C++ - Part 3     -  
 best way to implement a system of name servers     -  
 How to use Generics and implement it in Java     -  
 how to implement Dynamic DDS (Domain Name System)     -  
 How to implement Command Line Parser in C++ Code     -  
 Button action listener should implement abstract method     -  
 What is an Interface? !!!!     -  
 Iterator interface     -  

Topic Tags

PHP OOP