Translate

In this Post, I am going to show you some generally asked questions during the interview.

1.) What is Object Oriented Programming?
Object oriented programming-{OOP} is a programming language in which all the programming code organize around or with objects rather than other execution.
Objects are known as an instances of a class and used to interact with one another objects.

There are various languages in which object oriented language is used like: -
JavaScript(Object Oriented), PHP(Object Oriented), Objective-C, C++, .Net, Python, Ruby and etc.

The Main Purpose of using object oriented programming are:

1). Robust programming.
2). Easy understanding.
3). Reuse Functioning or Coding.
4). Easily to maintenance.
5). Easy evolution.


2.) What is data Modeling in OOPs?
In the class code, We create multiple get/set functions for getting and setting data with the protected function is known as Data Modeling in Object oriented.

class dataModel {
 public function __set( $key, $value ) 
  {
      $this->$key = $value;
   }
 }


3.) What is difference between class and interface?

1). Interface Don't have business logic in code.
2). for Using Interface we need to extend interface to use.
3). Code doesn't allow to create object of interface.

4). What do you know about PHP parse error?
We face the parse error when ever code gets syntax error into it.
With Example: - Each and every line should have semicolon in PHP. if we do not use the semicolon into it then, it shows the parse error and code get stop its execution. similarly, if we forget to use double quotes in string then we get parse error in code.
With this we get the exact line in PHP code where we get the error. So we can find the error and can correct it instantly.

In the Below written code, We will get the parse error into it. Because We didn't use the semicolon in line.


5). Objects can be passed by value or by reference?

In the Object oriented programming, Everything is passed by value.

If you feel any difficulty into the question then feel free to contact us. Don't forget to give feedback.
Thanks & Happy Coding,


0 comments:

Post a Comment

 
Top