What is an Interface?
An Interface is a class with no implementation. The only thing that it contains is the declaration of methods, properties, and events.
An Interface is a class with no implementation. The only thing that it contains is the declaration of methods, properties, and events.
Managed code is a code which is executed by CLR (Common Language Runtime) i.e all application code based on .Net Platform. It is cons...
Encapsulation – The Internal representation of an object is hidden from the view outside object’s definition. Only the required informati...
Bitbucket is experiencing a problem that is preventing this request from being successful. Rest assured that we are aware and are work...
A Class is an encapsulation of properties and methods that are used to represent a real-time entity. It is a data structure that brings ...
A console application is an application that can be run in the command prompt in Windows. For any beginner on .Net, building a console ...
C# is managed code because Common language runtime can compile C# code to Intermediate language.
DirectCast is used to convert the type of object that requires the run-time type to be the same as the specified type in DirectCast. Cty...
In a singleton pattern, a class can only have one instance and provides an access point to it globally. Ex: ...
C# provides developers a way to define declarative tags on certain entities, eg. Class, method, etc. are called attributes. The attribute...
"Throw" statement preserves original error stack whereas "throw ex" have the stack trace from their throw point. It i...
Indexers are known as smart arrays in C#. It allows the instances of a class to be indexed in the same way as an array.
A delegate having multiple handlers assigned to it is called multicast delegate. Each handler is assigned to a method.
"is" operator is used to check the compatibility of an object with a given type, and it returns the result as Boolean. ...
We can create an array with non-default values using Enumerable.Repeat.
Value types can take either their normal values or a null value. Such types are called nullable types. ex: Int? s...
Structs are value-type variables, and classes are reference types. Structs stored on the Stack causes additional overhead but faster retr...
Implement is up to you as the method is inside your own class. There might be a problem when the methods from different interfaces expect...
Declare the class as public and make the method sealed to prevent it from being overridden.
In an interface, we have virtual methods that do not have method definition. All the methods are there to be overridden in the derived cl...
Methods can be overloaded using different data types for a parameter, different order of parameters, and different number of parameters....
In method overriding, we change the method definition in the derived class that changes the method behavior. Method overloading is crea...
Colon is used as inheritance operator in C#. Just place a colon and then the class name. Ex: public class DerivedClass : Base...
Delegates are same are function pointers in C++, but the only difference is that they are type safe, unlike function pointers. Delegate...
Sometimes there are some errors that need to be handled as per user requirements. Custom exceptions are used for them and are used define...
ArgumentException, ArgumentNullException , ArgumentOutOfRangeException, ArithmeticException, DivideByZeroException ,OverflowException , I...
An object pool is a container having objects ready to be used. It tracks the object that is currently in use, total number of objects ...
Generics are used to make reusable code classes to decrease the code redundancy, increase type safety, and performance. Using generics, ...
Circular reference is situation in which two or more resources are interdependent on each other causes the lock condition and make the r...
Dispose() is called when we want for an object to release any unmanaged resources with them. On the other hand, Finalize() is used for t...
Interfaces have all the methods having only declaration but no definition. In an abstract class, we can have some concrete methods. In...
To catch an exception, we use try-catch blocks. Catch block can have a parameter of system.Exception type. { GetAllData(); } cat...
Using Sort() methods followed by Reverse() method.
Using Clone() method, we creates a new array object containing all the elements in the original Array and using CopyTo() method. All th...
System.String is immutable. When we modify the value of a string variable, then a new memory is allocated to the new value and the previo...
Protected Internal variables/methods are accessible within the same assembly and also from the classes that are derived from this parent ...
No, because they are not accessible outside the class.
In an array, we can have items of the same type only. The size of the array is fixed when compared. To an arraylist is similar to an arra...
Method overloading is creating multiple methods with the same name with unique signatures in the same class. When we compile, the compiler...
Protected Internal variables/methods are accessible within the same assembly and also from the classes that are derived from this parent ...
No, because they are not accessible outside the class.
In an array, we can have items of the same type only. The size of the array is fixed when compared. To an arraylist is similar to an arra...
Method overloading is creating multiple methods with the same name with unique signatures in the same class. When we compile, the compiler ...
We create sealed classes when we want to restrict the class to be inherited. Sealed modifier used to prevent derivation from a class. If ...
Custom Controls are controls generated as compiled code (Dlls), those are easier to use and can be added to toolbox. Developers can drag...
Value types are stored in the Stack, whereas reference types stored on heap.Value types: integer, enum, byte, decimal, double, float, l...
An Interface is an abstract class which has only public abstract methods, and the methods only have the declaration and not the definition....
Constant variables are declared and initialized at compile time. The value can't be changed afterward. Read-only is used only when we w...
We can't use 'This' in a static method because we can only use static variables/methods in a static method.
When we want to transport an object through a network, then we have to convert the object into a stream of bytes. The process of converting...
The 'using' block is used to obtain a resource and process it and then automatically dispose of when the execution of the block c...
An argument passed as ref must be initialized before passing to the method whereas out parameter needs not to be initialized before passi...
The Array which has elements of type array is called jagged Array. The elements can be of different dimensions and sizes. We can also cal...
A constructor is a member function in a class that has the same name as its class. The constructor is automatically invoked whenever an o...
An object is an instance of a class through which we access the methods of that class. "New" keyword is used to create an objec...
Public declared variables or methods are accessible anywhere in the application. Static declared variables or methods are globally access...
No, Multiple catch blocks can't be executed. Once the proper catch code executed, the control is transferred to the finally block, an...
C# is an object-oriented, type-safe, and managed language that is compiled by .Net framework to generate Microsoft Intermediate Language.
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; names...
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; nam...
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; names...
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; names...
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namesp...
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namesp...
public class Main{ static public void Insert_Sort(int[] array) { int cnt = array.Length; if (cnt == 1 || cnt == ...
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; public...
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; public...
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; public...
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; public...
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; public...
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; public...
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using ...
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; #reg...