Showing posts with label Oops FAQ's. Show all posts
Showing posts with label Oops FAQ's. Show all posts

Tuesday, 12 June 2012

Oops Interview Question and Answers


30) can we overload distructor() ?
      No, because it is parameter less.

31) what is namespace ?
      NameSpace  is a logical container. where in we can find classes,wnumerations,interfaces       delegates.

32) What is the purpose of namespace?
      To avoid the name collisions.

33) what is the diff b/w namespace and class ?
      --Namespace is used to avoid the name collisions
      -- class is used to implement encapsulation.

34)What is the alias name for namespaces and when it is required?
     When ever there is a  conflict among the members in the included namespaces, then we can      avoid it by providing alias nameto the member where there is a conflict.

35) What is the purpose of params keyword /
      params keyword is used to specify the  array of parameters to the method.

36) what is the diff between out and ref parameters ?
      Out parameters are write only parameters in side the method.
      Ref parameters are read-write parameters in side the method.

37) What is Binding ?
    Replacing method invokation with its appropriate base reference is called Binding.

38) What is static Binding ?
    If the binding process is carried out at the time of compilation is called Static bonding.

39) What is Dynamic binding ?
    If the binding process is carried out at the run time is called Dynamic bonding.

40) What are the diff b/w Method overloding and overriding ?
             
                 OverLoding                                                   OverRiding

       1. Nothing but no.of methods defined          1.Nothing but no.of methods defined with
           with the same name by showing the           same name and same signature.
           difference in signature part.
       2. Possible with in the same class and          2. possible in the derived class by
           derived class                                            the override keyword.
       3. possible for static, non-static methods      3.possible for only abstract and virtual
                                                                        methods.
41) What is polymorphism ?
      performing diff actions by invoking same invokation.

42) What is the diff between abstract calss and interface ?

                    abstract calss                                       Interface

        1. partially unimplemented                           1. Fully unimplipmented.
        2. Complete abstraction is not possible              2. Complete abstraction is                                                                         possble.
        3. All the types of members are allowed.             3. Onlymethods,properties,indexers
                                                                and events are allowed.
43) What is sealed class ?
      If a class is declared as sealed calss, then it can not be inherited ex: Thread class.

44) What is extension method?
       From c# 3.0 we can find this. we can extend the functionality of existing data type by          defining extension method.
       Always extension methos must be declared as static and defined in static class.

45)  What is the use of Dispose Method()?
     It is used to Invoke the Garbage collector dynamically.

46)  What is the diff b/w string and stringBuilder?
     StringBuilder : Manipulation can be done with is the object itself.
     String : String class objects will return another instance of the string for each               operation .
   
 
47)  What is the diff b/w Abstract method and Virtual method ?
 
              Abstract Method                           Virtual  Method
     1. Must be inside abstract class              1. It can be declared any where.
     2. Must be overrided in its derived class     2. It may or may not be overrided in its derived class.
     3. should not have the body in base class.    3. Must have the body in base class.

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

Saturday, 19 May 2012

Basic Concepts in Oops Frequently asked questions


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.

   

Object Oriented Programming FAQ's


 Can we overload distructor() ?
      No, because it is parameter less.

 What is namespace ?
      NameSpace  is a logical container. where in we can find classes,wnumerations,interfaces       delegates.

 What is the purpose of namespace?
      To avoid the name collisions.

 What is the diff b/w namespace and class ?
      --Namespace is used to avoid the name collisions
      -- class is used to implement encapsulation.

What is the alias name for namespaces and when it is required?
     When ever there is a  conflict among the members in the included namespaces, then we can      avoid it by providing alias nameto the member where there is a conflict.

 What is the purpose of params keyword /
      params keyword is used to specify the  array of parameters to the method.

 What is the diff between out and ref parameters ?
      Out parameters are write only parameters in side the method.
      Ref parameters are read-write parameters in side the method.

 What is Binding ?
    Replacing method invokation with its appropriate base reference is called Binding.

 What is static Binding ?
    If the binding process is carried out at the time of compilation is called Static bonding.

 What is Dynamic binding ?
    If the binding process is carried out at the run time is called Dynamic bonding.

 What are the diff b/w Method overloding and overriding ?
             
                 OverLoding                                                   OverRiding

       1. Nothing but no.of methods defined          1.Nothing but no.of methods defined with
           with the same name by showing the           same name and same signature.
           difference in signature part.
       2. Possible with in the same class and          2. possible in the derived class by
           derived class                                            the override keyword.
       3. possible for static, non-static methods      3.possible for only abstract and virtual
                                                                        methods.
 What is polymorphism ?
      performing diff actions by invoking same invokation.

 What is the diff between abstract calss and interface ?

                    abstract calss                                       Interface

        1. partially unimplemented                           1. Fully unimplipmented.
        2. Complete abstraction is not possible              2. Complete abstraction is                                                                         possble.
        3. All the types of members are allowed.             3. Onlymethods,properties,indexers
                                                                and events are allowed.
 What is sealed class ?
      If a class is declared as sealed calss, then it can not be inherited ex: Thread class.

 What is extension method?
       From c# 3.0 we can find this. we can extend the functionality of existing data type by          defining extension method.
       Always extension methos must be declared as static and defined in static class.

  What is the use of Dispose Method()?
     It is used to Invoke the Garbage collector dynamically.

  What is the diff b/w string and stringBuilder?
     StringBuilder : Manipulation can be done with is the object itself.
     String : String class objects will return another instance of the string for each               operation .
   
 
  What is the diff b/w Abstract method and Virtual method ?
 
              Abstract Method                           Virtual  Method
     1. Must be inside abstract class              1. It can be declared any where.
     2. Must be overrided in its derived class     2. It may or may not be overrided in its derived class.
     3. should not have the body in base class.    3. Must have the body in base class.