Tuesday, 12 June 2012

Basic Interview Question and Answers on Oops



1) what is the diff b/w object based programming and object based programming?
   -If the programming methodology supports encapsulation,Inheritance and polymorphiam then, it     is called Object Oriented programming language, it supports code extendability.
   -If the programming methodology supports only encapsulation then, it is called Object     based programming language, it supports code extendability.

2) what are the fundamental concepts of oops?
   -Encapsuplation
   -Inheritance
   -Polymorphism
3) what is encapsulation and its Advantagge?
    Grouping related thing together is called Encapsulation, we can acheive Portabily.

4) How to implement the encapsulation in c#?
   By using class,struct,properties,interface etc.

5) What is DataHiding ?
   Hiding unnecessary details from the user.

6) What is the Advantage of DataHiding ?
    Due to DataHiding behavior of the product can be protected, so that developers logic can be     secured.

7) What is Abstraction ?
    Hiding complete implementation details from the user is called abstraction.
     due to abstraction user will feel comfortable while working with the product.

8) Diff b/w DataHiding and Abstraction ?
    DataHiding  : Hiding unnecessary data from the user,programmer is benifited.
    Abstraction  : Hiding complete implementation details from the user,User is benifited.

9) What is class ?
    Class is a model or template regarding the thing.

10) What is an Object ?
    An instance of the class.

11) What is the diff b/w Encapsulation and class ?
      Encapsulation: Is a objcet oriented programming concept.
      Class: it is a feature of the language by which we can implement encapsulation.

12) What is the default access modifier for the class?
      Internal

13) What is the default access modifier for the members of the class?
      Private

14) What is the default access modifier for the members of the struct?
      Private

15) Diff b/w Class and Struct ?
   
                         Class                                       Struct
       1. Class is Object type                               1. Struct is value ttype
       2. All accessmodifiers are allowed.                   2. Protected is not supported
       3. Inheritance is possible.                           3. Not possible.
       4. Supports all types of constructors.                4. Default Constructor is not                                                                      supported.
       5. Distructor allowed.                                5. Not allowed.
       6. method overriding possible.                     6. Not possible.

16) What is Accessor Method and Mutator method ?
       Accessor Method:
      Any of the method is defined to access the value from the  instance variable.
      Mutator Method:
      Any of the method is defined to modify the value from the  instance variable.

17) what is the use of base Keyword ?
      To access the base class members in the derived class we can use base keyword.
      (or)
      To invoke the base class constructor from the derived calss constructor.

18) What is the diff b/w property and indexer ?
      If we use property we can get and modify the values from the instance variables .
      By using indexer we can access the object by applying subscript with index position.

19) What is Constructor ?
      Constructor is a special method in the class, which is used to initialize the instance       variables to some meaning full initial values, when the class is instantiated.

20) Why the name of Constructor and class is same ?
      For easy identification purpose of the compiler.

FIND MORE..

Tags:Basic Interview Question and Answers on Oops, Interview Question and Answers on Oops,Oops Interview question and answers

0 comments:

Post a Comment