An array is a group of like-typed variables that are referred to by a common name. And each data item is called an element of the array. The data types of the elements may be any valid data type like char, int, float, etc. and the elements are stored in a contiguous location.
Object array is used to store elements of the different types in a single array. In C#, an object reference may point to any derived type instance.
Disadvantages of Object array:
- It makes code more complex.
- It decrease the run-time of the program.
3.899 3 g Geeks System.Object
The dynamic array provides dynamic memory allocation, adding, searching, and sorting elements in the array. Dynamic array overcomes the disadvantage of the static array. In a static array, the size of the array is fixed but in a dynamic array, the size of the array is defined at run-time. List<T> is the dynamic arrays in C#.
Elements are: 23 1 78 45 543 Sorted element 1 23 45 78 543
- C# | Check if an array object is equal to another array object
- Difference between var and dynamic in C#
- Array.BinarySearch(Array, Object) Method with examples in C#
- Array.BinarySearch(Array, Int32, Int32, Object) Method with examples in C#
- C# | Array.BinarySearch(Array, Int32, Int32, Object, IComparer) Method
- C# | Array.BinarySearch(Array, Object, IComparer) Method
- Dynamic Type in C#
- C# Dynamic Coding - Attributes in Depth
- C# | Copying the SortedList elements to an Array Object
- C# | Class and Object
- Object and Collection Initializer in C#
- C# | Remove the first occurrence of a specific object from the ArrayList
- C# | Creating a synchronized (thread-safe) wrapper for a SortedList object
- Different ways to create an Object in C#
- C# | Get object at the top of the Stack - Peek operation
- C# | Insert an object at the top of the Stack - Push Operation
- C# | Add an object to the end of the Queue - Enqueue Operation
- C# | Get the object at the beginning of the Queue - Peek Operation
- C# | Add an object to the end of the ArrayList
- C# | Check if a SortedSet object is a proper superset of the specified collection
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.