Which code segment should you use?

You are creating a class to compare a specially-formatted string.
The default collation comparisons do not apply.
You need to implement the IComparable interface.
Which code segment should you use?

You are creating a class to compare a specially-formatted string.
The default collation comparisons do not apply.
You need to implement the IComparable interface.
Which code segment should you use?

A.
public class Person : IComparable{
public int CompareTo(string other){
}
}

B.
public class Person : IComparable{
public int CompareTo(object other){
}
}

C.
public class Person : IComparable{
public bool CompareTo(string other){
}
}

D.
public class Person : IComparable{
public bool CompareTo(object other){
}
}



Leave a Reply 1

Your email address will not be published. Required fields are marked *


mr_tienvu

mr_tienvu

I have the same idea. A