December 2001
Beginner
976 pages
22h 4m
English
We will show an example of a class implementing the IComparable interface next. Let's assume that you have the class Test, which has a field named m_testNo. You intend to use this class in a sorted collection, which requires the class to implement the IComparable so that it can be sorted by the m_testNo field.
NOTE
We will discuss collections later in the book. The only fact that matters now is that some of them require classes that implement the IComparable interface, which we use as an example.
The next example illustrates this class, implementing the interface IComparable.
Public Class Test
Implements IComparable Protected m_testNo As Integer Public Property testNo() As Integer Get Return m_testNo End Get Set m_testNo = ...Read now
Unlock full access