Category: OOPs Interview Questions

Difference between Procedural and Object Oriented Programming

Procedural Oriented Programming Object Oriented Programming In procedural programming, program is divided into small parts called functions. Example code : #include <stdio.h>/*this function computes the absolute value of a whole number.*/int abs(int x){if (x>=0) return x;else return -x;} /*this program calls the abs() function defined above twice.*/ int main() […]

How to call Constructor from another Constructor with same class in C# ?

Calling Constructor from another Constructor with same class There are two ways to do the above : 1. Use this keyword to acheive this . Example below :  public class Employee{    public Employee(): this(10)    {        // This is the no parameter constructor method.        // First Constructor    }     […]

What is Construction Overloading in C#

Constructor Overloading Constructor oveloading enables to have constructors with different sets of parameters. Example below: public class Employee {     public Employee()     {         // This is the no parameter constructor method.         // First Constructor     }     public Employee(int Age)     {         // This is the […]

%d bloggers like this: