What is C#?
C# (see sharp) is a computer programming language created by means of Microsoft to be used at the .NET platform. It is an object-oriented programming (OOP) language and is statically typed. Its call comes from the C language, from which it inherits a comparable syntax. C# is used to create Windows client programs, XML Web offerings, distributed components, client-server and database packages and more.
Can you provide an explanation for the reasons to use C# language?
- It is easy to learn.
- It is Structured language.
- Component oriented.
- Can be compiled on variety of laptop platforms.
- Produces efficient applications.
- Part of .Net framework.
Can you define an Object?
An object is an example of a class. It incorporates real values as opposed to variables
Can you define a class?
A magnificence is the widespread definition of what an object is. A Class describes all of the attributes of the object, as well as the strategies that put in force the behaviour of the member object.
Can you outline static key-word in C#?
Static keyword can be used for affirming a static member. If the class is made static then all of the participants of the class are also made static. If the variable is made static then it’s going to have a single example and the value change is updated in this instance.
Can you define LINQ in C#?
LINQ stands for Language Integrated Query. LINQ is a data querying technique which presents querying competencies to .NET languages with a syntax just like an SQL query
Can you provide an explanation for the difference among out and ref parameters in C#?
Out parameter may be exceeded to a technique and it want not be initialized while ref parameter must be initialized before it’s used.
Can you define Serialization in C#?
Serialization method saving the state of your object to secondary memory, together with a report or file.
Can you give an explanation for Encapsulation in C#?
Encapsulation is the method of mixing information and functions into a single unit known as class. In Encapsulation, the data isn’t accessed immediately; it’s miles accessed through the functions present in theclass.
Can you give an explanation for overriding in C#?
To override a base class approach which is described as digital, Override key-word is used.
Can you provide an explanation for jagged array in C#.Net?
A jagged array is an array whose elements are arrays. The factors of a jagged array can be of various dimensions and sizes. A jagged array is sometimes known as an “array of arrays.”
Can you give an explanation for an Interface in C#?
An interface is just like a category with technique signatures. There gained be any implementation of the techniques in an Interface. Classes which put in force interface ought to have an implementation of methods defined inside the summary class.
Can you explain multicast delegate in C#?
Delegate can invoke only one method reference has been encapsulated into the delegate.It is viable for positive delegate to keep and invoke a couple of methods such delegate called multicast delegates.Multicast delegates additionally referred to as combinable delegates,
Can you give an explanation for Polymorphism in C#?
The ability of a programming language to method objects in special methods depending on their data type or class is referred to as Polymorphism. There are forms of polymorphism
- Compile time polymorphism-Overloading
- Runtime polymorphism- Overriding
Can you explain Generics in C#?
Generics in c# is used to make the code reusable and which intern decreases the code redundancy and will increase the performance and kind protection.
Can we use this inside a static technique?
No, due to the fact static method does no longer guide example.
Can you explain IEnumerable and Enumerable?
IEnumerable: It’s far an interface and it’s part of system. Collection namespace, It has one techniques including GetEnumerator.
Enumerable: It is a class.It is part of LINQ library and is a gaggle of extension strategies written for the IEnumerable interface.
For More:
Can we inherit enum in C#?
No, Enum is default sealed.
What is the distinction among maintain and break statements in C#?
Continue assertion is used to bypass the manipulate to subsequent generation. This statement can be used with – whilst, for, foreach loops.
Break statement is used to go out the loop.
Can you define Constructor Chaining?
Constructor Chaining is a method in which a constructor calls another constructor within the identical or base class.
Can you give an explanation for Null Project in C#?
Null item is an object that encapsulates the absence of an object. It provides the do not anything conduct and returns the defaults. The Null object is used on every occasion object reference would had been null. The use of Null Object sample simplifies the patron code and makes it much less errors inclined.
Can you define Race Condition?
A Race condition takes place when two threads get right of entry to the equal aid and are trying to trade it on the identical time. The thread with a purpose to be able to get admission to the aid first can’t be predicted.
Can you declare variable in interface?
No, we can declare summary homes and features internal Interface.
Can you give an explanation for IEnumerable<> in C#?
IEnumerable is the figure interface for all non-usual collections in System.Collections namespace like ArrayList, HastTable and so forth. That may be enumerated. For the normal version of this interface as IEnumerable<T> which a discern interface of all typical collections class in System.Collections.Generic namespace like List<> and more.
Can you provide an explanation for Events?
Events are person actions that generate notifications to the software to which it need to respond. The user moves can be mouse moves, keypress and so on.
Can you provide an explanation for Abstract and sealed key-word in C#?
The abstract key-word allows you to create instructions and class contributors which can be incomplete and need to be implemented in a derived elegance. Abstract class essentially allows us to offer default capability for all of the infant classes through non-summary methods.
The sealed key-word enables you to save you the inheritance of a category or certain class contributors that were previously marked digital.
Can you give an explanation for Hashtable in C#?
It is used to store the key/value pairs based totally on hash code of the key. Key might be used to get entry to the detail in the collection
Can I use Finally block in C#?
Yes, C# 6.0 came with another new characteristic alongside Visual Studio 2015 and .NET 4.6. Now you will be able to write await operations in in catch {} and finally {} blocks too.
Can you explain Reference type and Value type Variable in C#?
Reference Type variables are stored inside the heap at the same time as Value Type variables are stored within the stack.
 Value Type: A Value Type shops its contents in reminiscence allocated on the stack. When you created aValue Type, a single area in memory is allotted to keep the price and that variable immediately holds a value.
Can you provide an explanation for Thread Pooling?
A Thread pool is a set of threads. These threads can be used to perform obligations without disturbing the number one thread. Once the thread completes the undertaking, the thread returns to the pool.
What is a Destructor in C#?
A Destructor is used to easy up the memory and free the sources. But in C# this is accomplished by using the garbage collector on its personal. System.GC.Collect() is referred to as internally for cleansing up. But on occasion it is able to be important to put in force destructors manuall.
Can you give an explanation for .PDB record?
Program Data Base PDB is a repository (chronic storage as databases) to keep the data required to run the program in debug mode.
Can you provide an explanation for Output parameters in C#?
A return statement can be used for returning best one value from a function. You can go back values from a function. Output parameters are similar to reference parameters, except that they switch records out of the technique as opposed to into it.