Home > Interview Questions > C#.NET > What is the use sort() method in C# Array?

What is the use sort() method in C# Array?

by Thamil   on 08/10/2015   Category: C#.NET   |  Level: Intermediate   |  Views: 1177    |  Points: 25     |  Gold 


Sort() method is used to sort the elements in the C# Array also it handles the different data types as well.
int[] numbers = { 10, 5, 2, 4, 8, 9, 1 };
Array.Sort(numbers);
foreach (int val in numbers)
{
Console.Write(val + " , ");
}
Console.ReadKey();

Output
1,2,4,5,8,9,10


« What is method overloading in C#?
» Is it possible to store multiple data types in System.Array in C#?
Post Question  |  Question Home

Recent Posts

User Responses


No response found, be the first to review this question.

Submit feedback about this code snippet

Please sign in to post feedback

Latest Posts