首先设计界面:一个Label标签
编写代码:‘
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace 泛型类
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
label1.Text = "";
Data<int> a = new Data<int> (3, 5, 2, 8, 7, 6 );
a.sort();
label1.Text = ""+a.display();
Data<float> b = new Data<float>(3.5f, 7.5f, 2.1f, 9.9f, 5.4f, 6.8f);
b.sort();
label1.Text += "