Is An Arrays A Class In C Sharp (Array Class)


While we use array in C# we use the length property to find the length of particular array. But have you ever notice that how's that length property we get in an array. Properties, Methods, Variable are the members of a class, Is there any class in .net who's named Array. So you are going to the right path, Yes, In .net we have a class names "Array". And whenever you create an array, it just create an object of that Array class. And you can get an access of instance member of that Array class.



1) In C#, arrays are actually objects.
2) System.Array is the abstract base type of all array types.
3) You can use the properties, and other class members, that System.Array has.
4) An example of this would be using the Length property to get the length of an array. 


int[] arr = new int[5];
arr.Length; //Length is the property of an Array class.



5) The System.Array class provides many other useful methods/properties, such as methods for sorting, searching, and copying arrays.



Is An Arrays A Class In C Sharp (Array Class) Is  An Arrays A Class In C Sharp (Array Class) Reviewed by Baljeet Singh on 05:13 Rating: 5

No comments:

Powered by Blogger.