Oops Interview Questions and Answers - 3
19. What is an abstraction?
Abstraction is an important feature of OOPS, and it shows only the necessary details to the client of an object.
Abstraction is a process of hiding the implementation details from the user, only the functionality will be provided to the user. In other words, the user will have the information on what the object does instead of how it does.20. What is early and late binding?
The compiler performs a process called binding when an object is assigned to an object variable. The early binding (static binding) refers to compile time binding and late binding (dynamic binding) refers to runtime binding.
While Early Binding, methods, functions and properties which are detected and checked during compile time and perform other optimizations before an application executes. The biggest advantage of using early binding is for performance and ease of development.
In Late binding functions, methods, variables and properties are detected and checked only at the run-time. It implies that the compiler does not know what kind of object or actual type of an object or which methods or properties an object contains until run time.21. What is a copy constructor?
This is a special constructor for creating a new object as a copy of an existing object. There will always be only one copy constructor that can be either defined by the user or the system.22. What is static and dynamic binding?
Connecting a method call to the method body is known as binding.
When compiler acknowledges all the information required to call a function or all the values of the variables during compile time, it is called “static binding”.
Calling a function or assigning a value to a variable, at run-time is called “Dynamic Binding”