Home » » OOP Interview Questions and Answers

OOP Interview Questions and Answers

Written By 1 on Tuesday, January 7, 2014 | 9:32 AM

Question: What is Object Oriented Programming?
It is programming technique where we use Object for programming. For example if we want to use any variable or function, we will use with the help of object.
Even if we need to make a function, then we will make function within some class.
It is far better the procedural programming because of easy to manage, understand and extend.

Question: What is difference between class and interface?
1) Interfaces do not contain business logic
2)You must extend interface to use.
3) You can't create object of interface.

Question: How Session - cookie works in PHP?
When a website open in new client machine(Browser), new sessionId is created and stored in php server and in client machine (In cookie).
All data is store in PHP Server and cookie only have sessionId. When client send sessionId with request to the server, then server fetch the data corresponsing to that sessionId and retun to the browser.

Question: What are some of the big changes PHP has gone through in the past few years?
5.1 added PDO
5.3 - added namespace support

Question: What is Polymorphism?
It is simply "One thing, can use in different forms"
For example, One car (class) can extend two classes (hond & Alta)


Question: How to load classes in PHP.
We can load a class with the use of "autoload" class.
If we want to change from default function autoload to testautload function.
we can do this with "spl_autoload_register"
spl_autoload_register('kumar');

0 Comment:

Post a Comment