PHP WEB DEVELOPMENT INTERVIEW QUESTIONS AND ANSWERS PREPARED BY ME OF PITANGENT ANALYTICS AND TECHNOLOGY SOLUTIONS PVT. LTD FOR FRESHERS (OOP'S CONCEPTS IN PHP - PART 3)
PHP WEB DEVELOPMENT INTERVIEW QUESTIONS AND ANSWERS PREPARED BY ME OF PITANGENT ANALYTICS AND TECHNOLOGY SOLUTIONS PVT. LTD FOR FRESHERS (OOP'S CONCEPTS IN PHP - PART 3)
Q1. Explain Encapsulation with a real-time example.
Ans: Encapsulation allows us to hide the attributes and methods within a class so that other classes won't have access to them. Real-Time Examples : Car, Bank Account. etc.
Q2. What is the difference between class and object with example.
Ans: Class - Class is a container which contains group of functions, variables and other class objects. Class is also known as the blueprint of objects. For ex. : class Car{...}.
Object - Object is the instance of a class. For ex. : $car1=new Car(), $car2=new Car().
Comments
Post a Comment