Logo

Difference between abstract class and interface. Write PHP code to create a parent class Book with properties title, author and price and a method…

BCA Scripting Language · 2026 · Solved Question with Answer

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.

Solution

Please login to view the answer.