Introduction (OOPS)

OOPS Programming allows us to develop smaller to smaller logical modules, later we can integrate into one form of software. OOPS includes classes under that methods, entities, events, properties, modules etc. By creating objects can access data in OOPS programming. .Net framework supports only OOPS languages such as vb.net, c#, asp.net, C++ etc. In my earlier example, I have covered almost all MVC ASP.Net Interview Questions And Answers.

1) What is class in .Net OOPS Programming?

Access modifiers allows us to access its class members in different types like Public, Private, Protected, Internal, Protected internal, Static.
Class Inheritance allow us to do to access its base class information and behaviour. Colon image permits us to inherit its base class from derive class.
public class Furniture
    {
        //Fields, properties, methods, members, events, constructors, destructors etc.
    }

2) What is Class and Class Inheritance in OOPS Programming?

public class Furniture
    {
        //Fields, properties, methods, members, events, constructors, destructors etc.
    }
 Public class Sandal:Furniture
    {
        //Fields, properties, methods, members, events, constructors, destructors etc.
    }

3) What are objects in OOPS?

Objects are like variable those who enable to encapsulate data and behaviour
Furniture _obj = new Furniture();

4) What are the basic concepts of OOPS ?

Main top four main features of OOPS are as follows:
I) Abstraction:- In .net framework, abstraction enable to use multiple inheritance, with the access of abstraction can hide important data and show only important data to show user.
II) Polymorphism: It capable to use one form into multiple forms.
II) Encapsulation: We can say encapsulation is subset of abstraction. We can restrict user to show data with the use of encapsulation.
IV) Inheritance: While we are using inheritance there are two main parts one is derived class and other one is base class. Inheritance provides to capable our application to reuse our code and reduce code size.
oops main components
OOPS main components

5). Which of the following type of class allows only one object of it to be created?

  • Virtual class
  • Abstract class
  • Singleton class
  • Friend class

6). Which of the following statements is correct?

  • Base class pointer cannot point to derived class.
  • Derived class pointer cannot point to base class.
  • Pointer to derived class cannot be created.
  • Pointer to base class cannot be created.

7). Which of the following is not the member of class?

  • Static function
  • Friend function
  • Const function
  • Virtual function

8). Which of the following concepts means determining at run time what method to invoke?

  • Data hiding
  • Dynamic Typing
  • Dynamic binding
  • Dynamic loading

9). Which of the class’s instances themselves are classes?

  • Subclass
  • Abstarct Class
  • Metaclass
  • Object Class

10). Which of the following concept of oops allows compiler to insert arguments in a function call if it is not specified?

  • Call by value
  • Call by reference
  • Default arguments
  • Call by pointer

11). Which of the following cannot be friend?

  • Function
  • Class
  • Object
  • Operator function

12). Which of the following concepts of OOPS means exposing only necessary information to client?

  • Encapsulation
  • Abstraction
  • Data hiding
  • Data binding

13). Why reference is not same as a pointer?

  • A reference can never be null.
  • A reference once established cannot be changed.
  • Reference doesn't need an explicit dereferencing mechanism.
  • All of the above.

14) Initialise var to null in C# ?

  • var _myVal = (dynamic)null; 
  • var _myVal = (int32)null; 
  • var _myVal = (int)null; 
  • var _myVal = (string)null; 
  • None;

15) What is Mutable string in .Net framework OOPS? 

  • A mutable string state can't be change 
  • A mutable string state can be change 
  • None 

16) What is Immutable string in .Net framework OOPS?

  • A Immutable string state can't be change 
  • A Immutable string state can be change
  • None
Read More: Difference between mutable and immutable string in .Net framework

17) What is boxing ?

  • Object to value 
  • Value to object 
  • Both A and B 
  • None
int a = 123;
object o = a;  //boxing

18) What is unboxing ? 

  • Object to value 
  • Value to object 
  • Both A and B 
  • None
o = 123;
a = (int)o;  // unboxing
Read More: What is Boxing and Unboxing in .Net Framework

19) Which modifier is used to class as a sealed class? 

  • Protected 
  • Private 
  • Sealed 
  • None 

20) A sealed class cannot be used as a base class? 

  • Yes 
  • No 
  • None 

21) Can be use sealed class as an abstract class? 

  • Yes 
  • No 
  • None 

22) Can be use sealed class for inheritance?

  • No 
  • Yes 
  • None 

23) Can be structs considered like sealed class? 

  • No 
  • Yes 
  • None
public sealed class Csharp
{
    // Class members here.
}

24) Can we instantiate Interface class ? 

  • Interface can be instantiated 
  • Interface cannot be instantiated 
  • Both A and B 
  • None 

25) Does Interface class require inheriting ?

  • No 
  • Yes 
  • None 

26) Which keyword is used to class as a sealed class?

  • Protected 
  • Private 
  • Sealed 
  • None 

 27) Does Interface class support inheriting?

  • Yes 
  • No 
  • None 

28) Can Interfaces contain only the declaration of the members?

  • Yes 
  • No 
  • None 

29) Which keyword is required to make Interface class?

  • Keyword
  • Sealed 
  • Interface
  • None

30) Interface class can contains only properties, indexers, methods, delegates and events signature?

  • No 
  • Yes 
  • None 

31) Can we instantiate abstract class?

  • No 
  • Yes 
  • None 

32) Can be an abstract class as a sealed class?

  • No
  • Yes
  • None

33) Can be an abstract class inherited from more than one class?

  • No 
  • Yes 
  • None 

34) An abstract class can contain constructors and destructor?

  • No 
  • Yes 
  • None 

35) Can it an abstract method likely implicitly virtual method?

  • No 
  • Yes 
  • None

Conclusion (OOPS)

OOPS provides great capability with Re-usability, Inheritance, Data Hiding, Reduced complexity of a problem, Easy to Maintain and Upgrade, Modifiable and Message Passing to develop high quality software with cost cutting.

OOPS, IIS and Other ASP.Net Interview Questions and Answers: