 
 Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Server Side Programming Articles - Page 2520 of 2650
 
 
			
			5K+ Views
The following are the access specifiers supported by C#.NET −Public Access SpecifierIt allows a class to expose its member variables and member functions to other functions and objects.Private Access SpecifierPrivate access specifier allows a class to hide its member variables and member functions from other functions and objects. Only functions of the same class can access its private members.Protected Access SpecifierProtected access specifier allows a child class to access the member variables and member functions of its base class.Internal Access SpecifierInternal access specifier allows a class to expose its member variables and member functions to other functions and objects in ... Read More
 
 
			
			192 Views
If you want to write binary information into the stream, then use the BinaryWriter class in C#. You can find it under the System.IO namespace.The following is the implementation of the BinaryWriter class −static void WriteMe() { using (BinaryWriter w = new BinaryWriter(File.Open("C:\abc.txt", FileMode.Create))) { w.Write(37.8); w.Write("test”); } } static void ReadMe() { using (BinaryReader r = new BinaryReader(File.Open("C:\abc.txt", FileMode.Open))) { Console.WriteLine("Value : " + r.ReadDouble()); Console.WriteLine("Value : " + r.ReadString()); } }Above, theBinaryWriter class opens a file and writes content into it ... Read More
 
 
			
			116 Views
The Item property of the BitArray class gets or sets the value of the bit at a specific position in the BitArray.Use the keyword to define the indexers instead of implementing the Item property. To access an element, use the mycollection[index].The following is the implementation of BitArray class Item property −Example Live Demousing System; using System.Collections; class Demo { static void Main() { bool[] arr = new bool[5]; arr[0] = true; arr[1] = true; arr[2] = false; arr[3] = false; BitArray ... Read More
 
 
			
			199 Views
Use the BinaryReader class if you want to read binary information from the stream.The BinaryReader class is in System.IO namespace.The following is an example showing using the BinaryReader class to read from a file −static void WriteMe() { using (BinaryWriter w = new BinaryWriter(File.Open("C:\abc.txt", FileMode.Create))) { w.Write(25.9); w.Write("DEMO DATA"); } } static void ReadMe() { using (BinaryReader r = new BinaryReader(File.Open("C:\abc.txt", FileMode.Open))) { Console.WriteLine("Value : " + r.ReadDouble()); Console.WriteLine("Value : " + r.ReadString()); } }The above method is called in the Main() method ... Read More
 
 
			
			2K+ Views
The conditional statement 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 be false.The following are the types of conditional statements −Sr.NoStatement & Description1if statementAn if statement consists of a boolean expression followed by one or more statements.2if...else statementAn if statement can be followed by an optional else statement, which executes when the boolean expression is false.3nested if statementsYou can use one ... Read More
 
 
			
			743 Views
With C#, you can create an array of integers, chars, etc. An array is used to store a collection of data, but it is often more useful to think of an array as a collection of variables of the same type stored at contiguous memory locations. This type can be integer, char, float, etc.The following is an array declaration showing the datatype usage −datatype[] Name_of_array;Here, datatype is used to specify the type of elements in the array.[ ] specifies the rank of the array. The rank specifies the size of the array.Name_of_array − specifies the name of the array.Set the ... Read More
 
 
			
			251 Views
To display numbers in the form of Triangle, firstly consider a two dimensional array.int[, ] a = new int[5, 5];For a triangle, you need to consider spaces as shown below −1 1 1 1 2 1 1 3 3 1Then loop through to set the triangle with 1s on the left and right as in the following code −Example Live Demousing System; class Demo { public static void Main() { // two dimensional array int[, ] a = new int[5, 5]; for (int i = 0; i < 5; ... Read More
 
 
			
			244 Views
The IStructuralComparable interface supports the structural comparison of collection objects. This interface introduced in .NET 4.The following is the syntax −public interface IStructuralComparableIt has a single method −CompareTo(Object, IComparer) − It determines whether the current collection object precedes, occurs in the same position as, or follows another object in the sort order.The compareTo() method determines whether the current collection object is less than, equal to, or greater than the second object in the sort order.Explicit implementations for the IStructuralComparable Interface is provided by −Generic tuple classes (Tuple, Tuple, Tuple,…Array class
 
 
			
			3K+ Views
The ICloneable interface creates a copy of the exisiting object i.e a clone.It only has a single method −Clone() − The clone() method creates a new object that is a copy of the current instance.The following is an example showing how to perform cloning using Icloneable interface −Example Live Demousing System; class Car : ICloneable { int width; public Car(int width) { this.width = width; } public object Clone() { return new Car(this.width); } public override string ToString() { return string.Format("Width of ... Read More
 
 
			
			1K+ Views
The IList interface has a non-generic collection of objects that can be individually accessed by index.The following are the properties of interface IList in C# −Sr.NoProperty Name & Description1CountGets the number of elements contained in the ICollection.2isFixedSizeGets a value indicating whether the IList has a fixed size.3isReadOnlyGets a value indicating whether the IList is read-only.4isSynchronizedGets a value indicating whether access to the ICollection is synchronized.5Item(Int32)Gets or sets the element at the specified index.The following are the methods of the IList interface −Sr.NoProperty Name & Description1Add(Obj)Adds an item to the IList.2Clear()Removes all items from the IList3Contains(Obj)Whether the list contains a specific ... Read More