using System;
using System.Collections.Generic;
public class Program
{
public static void Main()
List<int> li = new List<int>();
li.Add(4);
li.Add(3);
li.Add(2);
li.Add(1);
foreach( var item in li)
// Console.WriteLine(item);
}
li.mySort();
Console.WriteLine(item);
public static class myGenericClass
public static void mySort( this List<int> li)
int temp;
for( int i=0; i<li.Count; i++)
for( int j=0; j<li.Count-1; ++j)
if (li[i] < li[j])
//Swap the numbers
temp = li[i];
li[i] = li[j];
li[j] = temp;
}}