1. What is C#?
Answer:
It is an object oriented programming which runs on dotnet framework or dotnet core.This code will run on windows,mac,android.The standard editor will be visual studio starting from version 2010 to
2022.The code can be used in both windows applications and web applications.It is used to build API,Mobile,Web.
2. What are the different types of loops in C#?
Answer:
3. What are the different types of collections in C#?
Answer:
4. What are the design patterns in C#?
Answer:
Design patterns provide general solutions for common problems.The most common design patterns are:-
5. Whether it is possible to store different datatypes in an array in C#?
Answer:
Yes, in object array we can store different datatypes.For eg:-
This can be solved by declaring object array like the below
int[] samparr=new int[];
samparr[0]=1;
samparr[1]=2;
samparr[2]="str";// we cannot store string in integer array
Also we can store complex type inside this object array.
let us create an instance of an object and try to store inside this object array.
object[] objarr=new object[];
objarr[0]="str";
objarr[1]=1;
sales objsales=new sales();
objsales.salesid=1;
objsales.salesperson="Muruga";
objarr[2]=objsales;