• GK & Current Affairs
  • Exam Calender
  • IQ Puzzles
  • Comics Sections
  • Login
  • Registration
  • Reffer & earn
Knowledgedunia

,

  • Home
  • Category
    • Aptitude
    • General Studies
    • Reasoning
    • Puzzles
    • Programming Language
    • Interview
    • Database
    • Networking
    • Solr
  • Interview
  • Online Test
  • General Knowledge
    • Important Days
  • Ask Now !
  • Solr
  • HR
  • Puzzles
  • Reasoning

Time:

OOPs PHP Questions & Answer

  1. Home
  2. PHP
  3. OOPs

What is Object Oriented Programming?

6 years ago 517 Views

Object-oriented programming is an approach to programming where objects and classes are used. Object-Oriented PHP helps your code stay flexible by allowing it to be only defined once but used in many places.    The goals of object-oriented programming are Increased understanding, Ease of maintenance. Ease of evolution.

Basic concept of OOPs?

6 years ago 476 Views

  • Abstraction
  • Encapsulation
  • Inheritance
  • Polymorphism

What is MVC?

6 years ago 3586 Views

The model view controller pattern is the most used pattern for today’s world web applications. At present there are more than a dozen PHP web frameworks based on MVC pattern.The MVC pattern separates an application in 3 modules:
Model, View and Controller:

Model - The model is responsible to manage the data; it stores and retrieves entities used by an application, usually from a database, and contains the logic implemented by the application.

View - The view (presentation) is responsible to display the data provided by the model in a specific format. It has a similar usage with the template modules present in some popular web applications, like wordpress, joomla, …

Controller - The controller handles the model and view layers to work together. The controller receives a request from the client, invokes the model to perform the requested operations and sends the data to the View. The view formats the data to be presented to the user, in a web application as an html output.

What is Polymorphism?

6 years ago 495 Views

Polymorphism is the process of using an operator or function in different ways for different data input. In practical terms, polymorphism means that if class B inherits from class A, it doesn’t have to inherit everything about class A; it can do some of the things that class A does differently.

In general, polymorphism is the ability to appear in different forms. Technically, it is the ability to redefine methods for derived classes. Polymorphism is concerned with the application of specific implementations to an interface or a more generic base class.

What is the Scope Resolution Operator?

6 years ago 468 Views

The Scope Resolution Operator is a token that allows access to static, constant, and overridden properties or methods of a class. When referencing these items from outside the class definition, use the name of the class.

What is difference between class and interface?

6 years ago 473 Views

  • Interfaces do not contain business logic.
  • You must extend interface to use.
  • You can't create object of interface.

How to load classes in PHP?

6 years ago 486 Views

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('class_name');

What happen, If constructor is defined as private OR protected.

6 years ago 502 Views

If constructor declared as private, PHP through the following fatal error when create object. Fatal error: Call to private BaseClass::__construct() from invalid context in. If constructor declared as protected, PHP through the following fatal error when create object. Fatal error: Call to protected BaseClass::__construct() from invalid context in.

What is Static Keyword in PHP?

6 years ago 470 Views

  • If we declare a Method or Class Property as static, then we can access that without use of instantiation of the class.
  • Static Method are faster than Normal method.
  • $this is not available within Static Method.
  • Static properties cannot be accessed through the object(i.e arrow operator)
  • Calling non-static methods with Scope Resolution operator, generates an E_STRICT level warning.
  • Static properties may only be initialized using a literal or constant value.
  • Static properties/Normal properties Can't be initialized using expressions value.

What is Abstraction in PHP?

6 years ago 464 Views

  • Abstraction are defined using the keyword abstract.
  • PHP 5 introduces abstract classes and methods. Classes defined as abstract may not be instantiated (create object).
  • To extend the Abstract class, extends operator is used.
  • You can inherit only one abstract class at one time extending.
  • Any class that contains one abstract method must also be declare as abstract. Methods defined as abstract simply declare the method's signature, they can't define the implementation.
  • All methods marked as abstract in the parent's class, declaration must be defined by the child.
  • Additionally, these methods must be defined with the same (or a less restricted) visibility (Public,Protected & private).
  • Type hint & number of parameter must be match between parent & child class.

  • «
  • 1
  • 2
  • »

Hot Questions


  • What are the advantages and disadvantages of Standard Query Parser?
  • What is Apache Solr?
  • How to Get the Size of all Tables in a database in MySQL?

  • Explain Faceting in Solr.
  • What is MVC?

Recent Comments


  • Aziz Panna on
  • Brijesh Maurya on

    What is Laravel framework?

Knowledge Dunia
 
  • Solr Interview Questions
  • Earth Day Questions
  • PHP Interview Questions
  • HR Interview Questions
  • Important Day Of The Year
  • MySQL Interview Questions
  • General Awareness Questions
  • Railway Questions
  • CakePHP Interview Questions
  • Ask Your Question Now!
  • Sports Questions
  • About us
  • Contact Us
  • Facebook
  • Twitter
  • Google Plus

© 2016 cubetodice.com. All rights reserved.

Sign Up with Facebook
Sign Up with Google

OR

MALE FEMALE

By clicking on the button "Register" you agree to be the terms of service (User Agreement)

Already Register Sing In

×
Sign In with Facebook Sign In with Google

Forgot password?