c# Dot net interview questions

c#questions and answers

c# interview questions and Answers

1.When call by value, call by reference, call by out?

 
 CALL BY VALUE:
Whenever we want to pass some value to a function. The modifications are not expecting to reflect back. To actual parameter then we will pass it as CALL BY VALUE.
 
CALL BY REFERENCE:
Whenever we want to pass some value and we are expecting the modifications. Should be reflected back to actual parameter then we will pass it as CALL BY REFERENCE.
 
CALL BY OUT:
Whenever we don’t want to pass any values but we are expecting back the modifications. then we will pass the particular parameter as CALL BY OUT.
 
2. What is Encapsulation? How can we achieve?
 
A) Wrapping STATES and BEHAVIOURS called as ENCAPSULATION. (Or) Binding VARIABLES and METHODS called as ENCAPSULATION. By implementing class we can achieve ENCAPSULATION.
 
3. What is abstraction? How can we achieve?
 
Abstraction means HIDING.
 
Abstractions are 2 types.
 
1) data abstraction:-
 
Hiding unwanted data called as data abstraction
 
2) Method abstraction:-
 
Invoking required method and hiding unwanted method called as method abstraction.
 
With the help of FUNCTION OVERLOADING, we can achieve Method ABSTRACTION.
 
4. What is Inheritance? Types of Inheritance?
 
Inheriting or deriving members from one class. To another class called as INHERITANCE.
 
C#.Net will support 5 types of Inheritance. They are
  • Single Inheritance 
  • Multi-level Inheritance 
  • Many Inheritance 
  • Hierarchical Inheritance 
  • Hybrid Inheritance.
 5. Is C#.Net will support much Inheritance?
 
In C#.NET many inheritances are not possible by using classes. which is possible with the help of INTERFACES.
 
6. What sealed class? When will we go for sealed class?
 
While characterizing a class, in the event that we have utilized ―sealed‖ watchword. Then that class can be called as SEALED CLASS. It can’t be acquired.
 
At whatever point we need to confine to get a class we can go for fixed class.
 
7.Why property?

 

  • To assign the value to a class level variable. After creating the object to retrieve the value from the class level variable
     
  • The property will provide SECURITY to variable data.
     
  • The property will provide VALIDATION FACILITY for variable data.
    At the time of Assigning.
 
8. What is static polymorphism and dynamic polymorphism?
 
A) STATIC POLYMORPHISM:
 
A method which will bind at compile time will execute. In runtime called as static polymorphism or early binding or compile time polymorphism
 
DYNAMIC POLYMORPHISM:
 
A method which will bind at compile time will not execute, instead of that a method. which will bind at runtime will execute called as RUNTIME POLYMORPHISM.
 
9. What is function overloading? When will we go for function overloading?
 
A) FUNCTION OVERLOADING: Having many methods with the same name but a different no. of arguments or the different type of arguments or different order of arguments. In a single class or in a combination of base and derived class.
 
WHEN: Whenever we want to install the same method with the different functionalities. Then we have to go for FUNCTION OVERLOADING
 
10.Difference between constructor and property?
 
Constructor
 
It used to initialize the instance variables at the time of creating an object.
 
PROPERTY
 
It used to assign the value to the class level variables as well as can retrieve the value from class level variables
 

For more Dot net interview questions: click here

Dot training in Hyderabad: 

Kosmik provides dot net training in Hyderabad. we are providing lab facilities with complete real-time training and training based on advanced concepts.

 

Dot net interview questions and answers

dot net interview questions and answers for freshers

1.Difference between .Net Framework and VisualStudio.Net?

.NET FRAMEWORK

  • It is a run- time environment, which
    we can use to run applications.
  • It is required for .net developers and
    .net application end users
  • It is a freeware which we can
    download from Microsoft Website.

VISUAL STUDIO .NET

  • It is a development environment,
    which we can use to develop
    applications.
  • It is required for only .net developers.
  • It is not freeware which we have to
    purchase from Microsoft.

2 . What is JIT Compiler?

JIT (JUST-IN-TIME) Compiler will convert MSIL (Microsoft Intermediate Language) code to Native code because operating system can understand only Native code or machine code.

3 .What is CLS?
 . CLS (Common Language Specifications) is a set of common language standard defined by the Microsoft for all .NET Languages.

  .Every .NET Language has to follow CLS Standards.

 . Whenever a Programming Language wants to recognize as .NET Language then it has to follow CLS.

4. What is CTS?

–CTS (Common Type System) is a subset of CLS. It is a set of common

based data types defined by Microsoft for all .NET Languages.

–2. Every .NET Language has to map their data types with CTS types.

Common Type System

 

 

 

 

 

5. Explain .net application Execution process?

Diagram for .net application execution process :

A) .Net application Execution process can be divided into 2 steps:

.net applicationcompilation process

Step1. Converting HIGH level language code into MSIL (Microsoft Intermediate Language) with the help of language compilers because .Net execution engine (CLR) can understand only MSIL code.

Step2. JIT (JUST-IN-TIME) compiler will convert MSIL code to NATIVE code because operating system can understand only NATIVE code or MACHINE code.

6. What is MSIL Code?
.Microsoft Intermediate Language (MSIL), is one of the Core component of the

.NET Framework. Any .NET source codes written in any .net supportive language (C#, VB.net etc), when compiled are converted to MSIL. This MSIL, when installed or at Runtime, gets converted to the machine code. The Runtime conversion of MSIL code to the machine code is handled by a component called as the Just In Time (JIT) Compiler.

7.What is Managed Code and Unmanaged Code?

Managed Code

 A) Managed code:

 The code which is taking the help of CLR for execution is called as managed code.

 Example for Managed Code:-

 All .net languages code is managed code.

 VB.Net code, C#.Net code…etc

 B) Unmanaged code: –

 The code which is not taking the help of CLR for execution is called as Unmanaged code..

 Example for Unmanaged Code:-VB Code, VC++ Code…

 Note: – .net application can contain non .net code.

8. What is CLR?

 CLR stands for Common Language Runtime, it is .net execution.

CLR is a common execution engine for all .NET Languages that means

every .NET language application has to execute with the help of CLR.

Dot net training in hyderabad:-

Kosmik provides dot net training in Hyderabad. we are providing lab facilities with complete real time training and training based on advanced concepts. 

for latest Dot net interview questions and answers :-