- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Samual Sam has Published 2492 Articles
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
336 Views
Format DateTime using String.Format method.Let us see an example −Exampleusing System; static class Demo { static void Main() { DateTime d = new DateTime(2018, 2, 8, 12, 7, 7, 123); Console.WriteLine(String.Format("{0:y yy yyy yyyy}", d)); Console.WriteLine(String.Format("{0:M MM MMM ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
141 Views
ArrayList is a non-generic type of collection in C# that dynamically resizes.Let us see how to initialize ArrayList in C# −ArrayList arr= new ArrayList();Add an item to an Array List −ArrayList arr1 = new ArrayList(); arr1.Add(30); arr1.Add(70);Let us see the complete example to implement ArrayList in C#. Here we have ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
3K+ Views
Java has a final keyword, but C# does not have its implementation. Use the sealed or readonly keyword in C# for the same implementation.The readonly would allow the variables to be assigned a value only once. A field marked "read-only", can only be set once during the construction of an ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
548 Views
ClassClass is a blueprint for a data type. A class definition starts with the keyword class followed by the class name.StructA structure is a value type data type. It helps you to make a single variable hold related data of various data types. The struct keyword is used for creating ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
91 Views
Numeric promotion is the promotion of smaller types to larger types like short to int.In the below example, we have seen a numeric promotion in Conditional Expression.The short types are automatically promoted to larger type int.Exampleusing System; class Program { static void Main() { short ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
806 Views
Arrays were a pointer to an address in memory of the index. This index was the 1st element of the array. Here, the index is like an offset and the concept even before C language originated.Let’s say your array elements begins from 0Xff000 and has 5 elements like {35, 23, ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
1K+ Views
To set final for a local variable, use the read-only keyword in C#, since the implementation of the final keyword is not possible.The readonly would allow the variables to be assigned a value only once. A field marked "read-only", can only be set once during the construction of an object. ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
1K+ Views
Multi-dimensional arrayMulti-dimensional arrays are also called rectangular array. You can define a 3-dimensional array of integer as −int [ , , ] val;Let us see how to define a two-dimensional array.int[, ] val = new[3, 3] Jagged arrayA Jagged array is an array of arrays. To access an element from ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
2K+ Views
To copy or clone a C# list, firstly set a list −List < string > list1 = new List < string > (); list1.Add("One"); list1.Add("Two"); list1.Add("Three"); list1.Add("Four");Now declare a string array and use the CopyTo() method to copy.string[] arr = new string[20]; list1.CopyTo(arr);Let us see the complete code to copy ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
738 Views
The following is the difference between implicit and explicit type conversion −Implicit Type ConversionThese conversions are performed by C# in a type-safe manner.To understand the concept, let us implicitly convert int to long.int val1 = 11000; int val2 = 35600; long sum; sum = val1 + val2;Above, we have ... Read More