Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Question: Explain the concept of abstract classes.
Answer: Abstract classes cannot be instantiated and may contain abstract methods, which are methods without a body. Subclasses must provide implementations for all abstract methods.

Example:

abstract class Shape { 
abstract public function calculateArea(); 


class Circle extends Shape { 
public function calculateArea() 

// Implementation for Circle's area calculation 

}
Is it helpful? Yes No

Most helpful rated by users:

©2026 WithoutBook