PHP OOPs Part5
1. What is a copy constructor?
This is a special constructor for creating a new object as a copy of an existing object. There will be always only on copy constructor that can be either defined by the user or the system.
2. What does the keyword virtual represented in the method definition?
It means, we can override the method.
3. Whether static method can use non static members?
False.
4. What are base class, sub class and super class?
Base class is the most generalized class , and it is said to be a root class.Sub class is a class that inherits from one or more base classes.Super class is the parent class from which another class inherits.
5. What is static and dynamic binding?
Binding is nothing but the association of a name with the class. Static binding is a binding in which name can be associated with the class during compilation time , and it is also called as early Binding.
Dynamic binding is a binding in which name can be associated with the class during execution time , and it is also called as Late Binding.
6. How many instances can be created for an abstract class?
Zero instances will be created for an abstract class.
7. Which keyword can be used for overloading?
Operator keyword is used for overloading.
8. What is the default access specifier in a class definition?
Private access specifier is used in a class definition.
9. Which OOPS concept is used as reuse mechanism?
Inheritance is the OOPS concept that can be used as reuse mechanism.
10. Which OOPS concept exposes only necessary information to the calling functions?
Data Hiding / Abstraction