Abstract Class and Abstract Method in PHP (Hindi)

Rate this post



Abstract Class and Abstract Method in PHP

Core PHP Tutorials:

HTML Tutorials :

CSS Tutorials:

SQL Tutorials:

Check Out Our Other Playlists:

SUBSCRIBE to Learn Programming Language !

Learn more about subject:

________________________________________________

If you found this video valuable, give it a like.
If you know someone who needs to see it, share it.
If you have questions ask below in comment section.
Add it to a playlist if you want to watch it later.
________________________________________________

T A L K W I T H M E !
Business Email: contact@geekyshows.com
Youtube Channel:
Facebook:
Twitter:
Google Plus:
Website:
_______________________________________________

Make sure you LIKE, SUBSCRIBE, COMMENT, and REQUEST A VIDEO! 🙂
_______________________________________________

Tag: abstract class php, Server, Web Application, Create Web Application, WebSite, PHP, PHP in Hindi, PHP in Urdu, PHP tutorials, php tutorial for beginners full, php programming, php mysql tutorial, Advance PHP, PDO, PHP OOP

Xem Thêm Bài Viết Review Khác: https://chơigame.vn/review

Nguồn: https://chơigame.vn

15 Comments

  1. <?php

    abstract class Shape{

    protected $color;

    abstract function calculateArea();

    public function getColor(){

    return $this->color;

    }

    }

    class Rectangular extends Shape{

    public $height;

    public $width;

    function calculateArea($color, $height, $width){

    $this->color = $color;

    $this->height = $height;

    $this->width = $width;

    return $this->height * $this->width;

    }

    }

    class Circle extends Shape{

    public $radius;

    function calculateArea($color, $radius){

    $this->color = $color;

    $this->radius = $radius;

    return $this->radius * 3.14;

    }

    }

    $rect = new Rectangular();

    echo $rect->calculateArea("red", 10, 20);

    $cir = new Circle();

    echo $cir->calculateArea("blue", 10);

    ?>
    Fatal error: Declaration of Rectangular::calculateArea($color, $height, $width) must be compatible with Shape::calculateArea() in C:xampphtdocsoopdataabstractionData1.php on line 13

    Reply
  2. What is the output of the following code?
    abstract class Calc {
    abstract public function calculate($param);
    protected function getConst() { return 4; }
    }
    class FixedCalc extends Calc {
    public function calculate($param) {
    return $this->getConst() + $param;
    }
    }
    $obj = new FixedCalc();
    echo $obj->calculate(38);. Plz suggest ans

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *