Dot Net
Dot net,dot net validations,imp queries
Wednesday, July 23, 2025
Sunday, February 7, 2021
Dot net Interview Questions and Answers 2021
Note: I will Update the answers later
Ans: Object-Oriented Programming (OOP) All Programming Language will support this OOP there are Three main concepts in OOP
a)Encapsulation
b)Abstraction
c)Inheritance
d)Polymorphism
OR
Simple Putting Together into one simple class Like.
OR
Means that a group of related properties, methods, and other members are treated as a single unit or object.
_____________________________________________________________
Class My Class
{
public MyClass()
{
}
int a;
int b;
Public void GetAdd()
{
int C=a+b;
}
}
____________________________________________________________
Abstraction : Hiding the Data
OR
Acquiring the Properties of Base Class(Parent Class)
OR
Means Provide Further Implementation ,Reusing of Base Class
__________________________________________________________
Public Class MyClass
{
Public MyClass()
{
}
int a;
int b;
Public void GetMyMethod()
{
int c=a+b;
}
}
Public Class MyChildClass : MyClass
{
Public MyChildClass()
{}
}
C# Doesn't Support Multiple Inheritance By Using Interfaces We Can
Example of Compile Time Polymorphism: Method Overloading
Example of Run Time Polymorphism: Method Overriding
Method Overloading- Method with same name but with different arguments is called method overloading.
- Method Overloading forms compile-time polymorphism.
- Example of Method Overloading:
class MyClass
{
Public string hello()
{
return "Hello";
}
public string hello(string s)
{
return "Hello"+S.Tostring();
}
}
Method Overriding- Method overriding occurs when child class declares a method that has the same type arguments as a method declared by one of its superclass.
- Method overriding forms Run-time polymorphism.
-Virtual Key word is required for Overriding
- Example of Method Overriding:
Public Class MyClass
{
virtual void hello()
{
Console.WriteLine(“Hello from MyClass”);
}
}
Public Class MyChildchild : MyClass
{
override void hello()
{
Console.WriteLine(“Hello from Child”); }
}
}________________________________________________
Ans: Object-Oriented Programming (OOP) All Programming Language will support this OOP there are Three main concepts in OOP
a)Encapsulation
b)Abstraction
c)Inheritance
d)Polymorphism
Encapsulation :
Encapsulation is the process of Keeping the data and method together into ObjectsOR
Simple Putting Together into one simple class Like.
OR
Means that a group of related properties, methods, and other members are treated as a single unit or object.
_____________________________________________________________
Class My Class
{
public MyClass()
{
}
int a;
int b;
Public void GetAdd()
{
int C=a+b;
}
}
____________________________________________________________
Abstraction : Hiding the Data
Inheritance:
Inheritance Enables you to Create Class that ReusesOR
Acquiring the Properties of Base Class(Parent Class)
OR
Means Provide Further Implementation ,Reusing of Base Class
__________________________________________________________
Public Class MyClass
{
Public MyClass()
{
}
int a;
int b;
Public void GetMyMethod()
{
int c=a+b;
}
}
Public Class MyChildClass : MyClass
{
Public MyChildClass()
{}
}
C# Doesn't Support Multiple Inheritance By Using Interfaces We Can
Polymorphism
Polymorphism means same operation may Behave Differently in Different ClassesExample of Compile Time Polymorphism: Method Overloading
Example of Run Time Polymorphism: Method Overriding
Method Overloading- Method with same name but with different arguments is called method overloading.
- Method Overloading forms compile-time polymorphism.
- Example of Method Overloading:
class MyClass
{
Public string hello()
{
return "Hello";
}
public string hello(string s)
{
return "Hello"+S.Tostring();
}
}
Method Overriding- Method overriding occurs when child class declares a method that has the same type arguments as a method declared by one of its superclass.
- Method overriding forms Run-time polymorphism.
-Virtual Key word is required for Overriding
- Example of Method Overriding:
Public Class MyClass
{
virtual void hello()
{
Console.WriteLine(“Hello from MyClass”);
}
}
Public Class MyChildchild : MyClass
{
override void hello()
{
Console.WriteLine(“Hello from Child”); }
}
}________________________________________________
2.What are value types and reference types?
A: Integer is a value type. The string is a reference type.
3. What is the use of IS and AS Keywords?
A: Typecasting.
4.What are the generic delegates and what is the use of that?
5.What is the use of extension methods and anonymous methods?
6.What is the Static class?
7.Can we use the "this" keyword in the Static class?
A: No
8.What is the difference between read-only and constant?
9.What is the difference between var and dynamic?
10.What is the difference between Interface and abstract?
11. What is the use of async and await keywords?
Wednesday, September 14, 2016
LINQ to SQL protects from SQL-injection attacks
Q.How is LINQ to SQL protected from SQL-injection attacks?
A.SQL injection has been a critical danger for traditional SQL queries shaped by concatenating client input.
LINQ to SQL avoids sql injection by utilizing SqlParameter as a part of queries.
User information is transformed into parameter values.
This methodology keeps malicious commands from being utilized from customer input
A.SQL injection has been a critical danger for traditional SQL queries shaped by concatenating client input.
LINQ to SQL avoids sql injection by utilizing SqlParameter as a part of queries.
User information is transformed into parameter values.
This methodology keeps malicious commands from being utilized from customer input
Subscribe to:
Comments (Atom)