當用VS2008自動創建一個類時都會包含一下幾個空間命名:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
當用這份創建的類實現ICompare藉口時,會提示你要使用IComparer<T>,實現這個藉口後,如果你要實現ArrayList中的 Sort(ICompare comparer)時,你實現的這個 IComparer<T>泛型藉口不能使用!因爲ArrayList中的sort()不支持泛型
解決辦法是用using System.Collection中的ICompare藉口,而不用泛型!
//Person類
//測試類