Site icon SKLEARNING

volkswagen interview question for .net developer

C#feature
  • What are the Pillar of OOPS and Explain?

The four pillars for OOP are Abstraction, Encapsulation, Inheritance, Polymorphism.

  1.  Abstraction : Abstraction is the process of showing only essential/necessary features of an entity/object to the outside world and hide the other irrelevant information. For example to open your TV we only have a power button, It is not required to understand how infra-red waves are getting generated in TV remote control.
    2. Encapsulation : Encapsulation means wrapping up data and member function (Method) together into a single unit i.e. class. Encapsulation automatically achieve the concept of data hiding providing security to data by making the variable as private and expose the property to access the private data which would be public.
    3. Inheritance : The ability of creating a new class from an existing class. Inheritance is when an object acquires the property of another object. Inheritance allows a class (subclass) to acquire the properties and behavior of another class (super-class). It helps to reuse, customize and enhance the existing code. So it helps to write a code accurately and reduce the development time.
    4. Polymorphism: Polymorphism is derived from 2 Greek words: poly and morphs. The word “poly” means many and “morphs” means forms. So polymorphism means “many forms”. A subclass can define its own unique behavior and still share the same functionalities or behavior of its parent/base class. A subclass can have their own behavior and share some of its behavior from its parent class not the other way around. A parent class cannot have the behavior of its subclass.
  • What is interface in C# ?

  • What type of Project , you are doing?

  • What is Abstract method in C#?

  • What is delegate?

A delegate is an object which refers to a method or you can say it is a reference type variable that can hold a reference to the methods. Delegates in C# are similar to the function pointer in C/C++. It provides a way which tells which method is to be called when an event is triggered.
For example, if you click on a Button on a form (Windows Form application), the program would call a specific method. In simple words, it is a type that represents references to methods with a particular parameter list and return type and then calls the method in a program for execution when it is needed.


Important Points About Delegates:

Provides a good way to encapsulate the methods.

Delegates are the library class in System namespace.

These are the type-safe pointer of any method.

Delegates are mainly used in implementing the call-back methods and events.

Delegates can be chained together as two or more methods can be called on a single event.

It doesn’t care about the class of the object that it references.

Delegates can also be used in “anonymous methods” invocation.

Anonymous Methods(C# 2.0) and Lambda expressions(C# 3.0) are compiled to delegate types in certain contexts. Sometimes, these features together are known as anonymous functions.

Delegate type can be declared using the delegate keyword. Once a delegate is declared, delegate instance will refer and call those methods whose return type and parameter-list matches with the delegate declaration.

Syntax:

[modifier] delegate [return_type] [delegate_name] ([parameter_list]);

 

 

  • Can We inherit the interface in class?

  • Show all the row of one table and comman id row of another table in SQL Server?

  • Rate yourself in C# out of 5?

Exit mobile version