Difference between String and StringBuilder in C#

Ankith Reddy
Published on 17-Sep-2018 12:00:23
Strings in C# String is immutable in C# that would mean you couldn’t modify it after it is created. It creates a new object of string type in memory if you will perform any operation. string str1 = "Welcome!"; // creates a new string instance str1 += "Hello"; str1 ... Read More

Difference between Boxing and Unboxing in C#

Samual Sam
Published on 17-Sep-2018 11:59:51
Boxing convert value type to an object type whereas unboxing converts object type to the value type. Let us see the difference between Boxing and Unboxing in C#. Storage In boxing, the value stored on the stack is copied to the object stored on heap memory, whereas unboxing is the ... Read More

Difference between Abstract Class and Interface in C#

Arjun Thakur
Published on 17-Sep-2018 11:55:39
Interfaces define properties, methods, and events, which are the members of the interface. Interfaces contain only the declaration of the members. It is the responsibility of the deriving class to define the members. Abstract classes to some extent serve the same purpose, however, they are mostly used when only few ... Read More

Difference between == and .Equals method in c#

karthikeya Boyini
Published on 17-Sep-2018 11:54:53
The Equality Operator ( ==) is the comparison operator and the Equals() method in C# is used to compare the content of a string.The Equals() method compares only content.Example Live Demousing System; namespace ComparisionExample {    class Program {       static void Main(string[] args) {         ... Read More

Delegates in C#

Chandu yadav
Published on 17-Sep-2018 11:51:53
A delegate in C# is a reference to the method. A delegate is a reference type variable that holds the reference to a method. The reference can be changed at runtime.Delegates are especially used for implementing events and the call-back methods. All delegates are implicitly derived from the System.Delegate class.Let ... Read More

Default constructor in C#

Samual Sam
Published on 17-Sep-2018 11:48:04
A Constructor in C# is invoked automatically when an object gets created. The constructor has the same name as that of the class, for example −public class Department {    public Department () {       Console.WriteLine("Default Constructor! ");    } }The following is the code that shows the ... Read More

Decision Making in C#

George John
Published on 17-Sep-2018 11:43:20
Decision making structures requires the programmer to specify one or more conditions to be evaluated or tested by the program, along with a statement or statements to be executed if the condition is determined to be true, and optionally, other statements to be executed if the condition is determined to ... Read More

Constructors in C#

karthikeya Boyini
Published on 17-Sep-2018 11:42:48
A Constructor in C# gets invoked automatically when a object gets created. The constructor has the same name as that of the class, for example −public class Department {    public Department () {       Console.WriteLine("Default Constructor! ");    } }The following is the code that shows the ... Read More

Constructor Overloading in C#

Ankith Reddy
Published on 17-Sep-2018 11:37:14
When more than one constructor with the same name is defined in the same class, they are called overloaded, if the parameters are different for each constructor.Let us see an example to learn how to work with Constructor Overloading in C#.In the example, we have two subjects and a string ... Read More

Compound assignment operators in C#

Samual Sam
Published on 17-Sep-2018 11:36:53
A compound assignment operator has a shorter syntax to assign the result. The operation is performed on the two operands before the result is assigned to the first operand.The following are the compound assignment operators in C#.Sr.NoOperator & Operator Name1+=Addition Assignment2-=Subtraction Assignment3*=Multiplication Assignment4/=Division Assignment5%=Modulo Assignment6&=Bitwise AND Assignment7|=Bitwise OR Assignment8^=Bitwise XOR ... Read More
Advertisements