Experiment 9 1
Experiment 9 1
Experiment 9 1
<?php
// Abstract class
abstract class Media {
protected $title;
protected $author;
const MEDIA_TYPE = 'General';
// Interface
interface Borrowable {
public function borrow($borrower);
}
// Inheritance
class Book extends Media implements Borrowable {
private $isbn;
public static $totalBooks = 0;
// Usage
$libraryItems = [
new Book("1984", "George Orwell", "123456789"),
new Magazine("National Geographic", "Various", "2023-09")
];
?>
Conclusion:-
Thus, we have studied, understood and practically checked Advanced OOP concepts in
php.