Array Class Tp2a by MR Sonwabiso (2024)
Array Class Tp2a by MR Sonwabiso (2024)
3. Copy (src, dest, n): Copying some of the elements or all elements from the old
array to the new array
5. Length: It Returns the total number of elements in all the dimensions of the Array;
zero if there are no elements in the array.
namespace ArayDemo
class Program
Console.WriteLine();
//Sorting the Array Elements by using the Sort method of Array Class
Array.Sort(Numbers);
Console.WriteLine();
//Reversing the array elements by using the Reverse method of Array Class
Array.Reverse(Numbers);
Console.WriteLine();
//Creating a New Array
//We declare the array with size 10 and we copy only 5 elements.
//So the rest 5 elements will take the default value. In this array, it will take 0
Console.WriteLine();
Console.ReadKey();