At least one object must implement IComparable

后端 未结 5 377
攒了一身酷
攒了一身酷 2020-12-06 08:48
using System;
using System.Xml;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
             


        
5条回答
  •  旧巷少年郎
    2020-12-06 09:36

    Your Player class must implement the IComparable interface. The SortedSet holds the items in a sorted order, but how would it know what the sorted order is if you haven't told it how to sort them (using IComparable)?

提交回复
热议问题