PHP Exam Questions and Answers
Write basic concepts of OOP - Answer-Abstraction.
Encapsulation.
Inheritance.
Polymorphism.
What is a class - Answer-A class is simply a representation of a type of object. It is the blueprint/ plan/
template that describes the details of an object.
What is an object - Answer-An object for constructor as an instance of a class, and it has its own state,
behavior, and identity
Encapsulation - Answer-exposes only necessary information to the calling functions
Encapsulation is an attribute of an object, and it contains all data which is hidden. That hidden data can
be restricted to the members of that class.
Levels are Public, Protected, Private, Internal and Protected Internal.
Polymorphism - Answer-It's simply the idea that one object can take on many forms. So in PHP OOP one
class "cars" may have two classes that extend it, for example a "Honda" class and a "BMW" class.
Write basic concepts of OOP - Answer-Abstraction.
Encapsulation.
Inheritance.
Polymorphism.
What is a class - Answer-A class is simply a representation of a type of object. It is the blueprint/ plan/
template that describes the details of an object.
What is an object - Answer-An object for constructor as an instance of a class, and it has its own state,
behavior, and identity
Encapsulation - Answer-exposes only necessary information to the calling functions
Encapsulation is an attribute of an object, and it contains all data which is hidden. That hidden data can
be restricted to the members of that class.
Levels are Public, Protected, Private, Internal and Protected Internal.
Polymorphism - Answer-It's simply the idea that one object can take on many forms. So in PHP OOP one
class "cars" may have two classes that extend it, for example a "Honda" class and a "BMW" class.