CACS254 Scripting Language

Scripting LanguageTU Board 2026

Difference between abstract class and interface. Write PHP code to create a parent class Book with properties title, author and price and a method displayBookDetails(). Also create two subclasses…

10

Difference between abstract class and interface. Write PHP code to create a parent class Book with properties title, author and price and a method displayBookDetails(). Also create two subclasses TextBook and ReferenceBook that inherit from Book. Add property subject in TextBook and edition in ReferenceBook. Create methods to display complete details of each book. [3+7]

A worked answer is on its wayMeanwhile, read the Scripting Language notes for this topic.

Discussion

Loading…

More Scripting Language questions

All Scripting Language old questions