IComparable

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Simon

    #1

    IComparable

    Hi all

    I have a class implements IComparable interface, however, I got a error on the following method

    protected override int IComparable.Com pareTo(object value

    ..


    Does anyone know the reason? one thing question is what is the difference between string and String in C#

    Thanks in advance

    Simon
  • Miha Markic

    #2
    Re: IComparable

    Hi Simon,

    Is this class implementing IComparable?
    Why do you override it?


    "Simon" <simon_k_y_wong @yahoo.com> wrote in message
    news:908A33E9-DA6D-41D1-9EF7-247FFDE23B26@mi crosoft.com...[color=blue]
    > Hi all,
    >
    > I have a class implements IComparable interface, however, I got a error on[/color]
    the following method.[color=blue]
    >
    > protected override int IComparable.Com pareTo(object value)
    > {
    > ...
    > }
    >
    > Does anyone know the reason? one thing question is what is the difference[/color]
    between string and String in C#?

    None.

    --
    Miha Markic - RightHand .NET consulting & development
    miha at rthand com



    Comment

    • Ed Kaim [MSFT]

      #3
      Re: IComparable

      Try changing the signature to "public int CompareTo(objec t value)".

      "Simon" <simon_k_y_wong @yahoo.com> wrote in message
      news:908A33E9-DA6D-41D1-9EF7-247FFDE23B26@mi crosoft.com...[color=blue]
      > Hi all,
      >
      > I have a class implements IComparable interface, however, I got a error on[/color]
      the following method.[color=blue]
      >
      > protected override int IComparable.Com pareTo(object value)
      > {
      > ...
      > }
      >
      > Does anyone know the reason? one thing question is what is the difference[/color]
      between string and String in C#?[color=blue]
      >
      > Thanks in advanced
      >
      > Simon[/color]


      Comment

      Working...