Enum with Customized Value in C#

George John
Published on 17-Sep-2018 12:18:50
Enum is Enumeration to store a set of named constants like year, product, month, season, etc.The default value of Enum constants starts from 0 and increments. It has fixed set of constants and can be traversed easily. However you can still change the start index and customize it with the ... Read More

Enum in C#

karthikeya Boyini
Published on 17-Sep-2018 12:17:15
Enum is Enumeration to store a set of named constants like year, product, month, season, etc.The default value of Enum constants starts from 0 and increments. It has fixed set of constants and can be traversed easily.Let us see an example.We have set the enum like this −public enum Vehicle ... Read More

Encapsulation in C#

Ankith Reddy
Published on 17-Sep-2018 12:14:01
Encapsulation in C# prevents access to implementation details. Implement Encapsulation in C# using access specifiers.The following are the access specifiers supported by C#.PublicPrivateProtectedInternalProtected internalEncapsulation can be understood by taking an example of private access specifier that allows a class to hide its member variables and member functions from other functions ... Read More

Division Operator in C#

Samual Sam
Published on 17-Sep-2018 12:13:36
Division operator is used in C# to divide numerator by denominator, for example 9/ 3The division operator comes under Arithmetic Operators in C#. Let us see a complete example to learn how to implement Arithmetic operators in C#, wherein we will see how to work with division operator.result = num1 ... Read More

Differences between C and C#

Arjun Thakur
Published on 17-Sep-2018 12:10:29
C is a general-purpose, high-level language that was originally developed by Dennis M. Ritchie to develop the UNIX operating system at Bell Labs. C was originally first implemented on the DEC PDP-11 computer in 1972. C# is a simple, modern, general-purpose, object-oriented programming language developed by Microsoft within its .NET ... Read More

Difference between IComparable and IComparer Interface in C#

karthikeya Boyini
Published on 17-Sep-2018 12:10:00
IComparable Interface in C#Use the IComparable Interface in C# to sort elements. It is also used to compare the current instance with another object of same type.It provides you with a method of comparing two objects of a particular type. Remember, while implementing the IComparable interface, CompareTo() method should also ... Read More

What is the IsReadOnly property of Hashtable class in C#?

Chandu yadav
Published on 17-Sep-2018 12:07:23
The IsReadOnly property of Hashtable class is used to get a value indicating whether the Hashtable is read-only.Example Live Demousing System; using System.Collections; namespace Demo {    class Program {       static void Main(string[] args) {          Hashtable ht = new Hashtable();         ... Read More

What is the scope of an internal variable of a class in C#?

Samual Sam
Published on 17-Sep-2018 12:06:28
Internal variable is set using the internal access specifier.internal double length; internal double width;Any member with internal access specifier can be accessed from any class or method defined within the application in which the member is defined.Example Live Demousing System; namespace RectangleApplication {    class Rectangle {       //member ... Read More

Different Methods to find Prime Numbers in C#

George John
Published on 17-Sep-2018 12:03:19
The following are the two ways through which you can find a prime number in C#.Check Prime Number using for loop Live Demousing System; namespace Program {    class Demo {       public static void Main() {          int n =7;          int ... Read More

Differences between C++ and C#

karthikeya Boyini
Published on 17-Sep-2018 12:02:56
C++ is a statically typed, compiled, general-purpose, case-sensitive, free-form programming language that supports procedural, object-oriented, and generic programming. C++ is regarded as a middle-level language, as it comprises a combination of both high-level and low-level language features. C# is a simple, modern, general-purpose, object-oriented programming language developed by Microsoft within ... Read More
Advertisements