Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 30th, 2008, 12:12 AM
Registered User
 
Join Date: May 2008
Location: Mumbai, Maharashtra, India.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default iComparable

Hey guys, I am having a great difficulty in understanding the use of iComparable from the Wrox ASP.NET 2.0 book(proffesionals).
 Can anyone explain this to me or provide some neat links to understand?

  #2 (permalink)  
Old May 30th, 2008, 02:39 AM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

I don't have access to the book, but here's how I view the interface.

IComparable is used to allow two objects of the same type to be compared. This allows them to be sorted and ordered (such as when using sorted lists).

The method IComparable provides, CompareTo, simply compares the current object with the supplied parameter, returning 0 if the two items are identical, -1 if the instance is less than the parameter, and +1 if the instance is greater than the parameter.

/- Sam Judson : Wrox Technical Editor -/
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off




All times are GMT -4. The time now is 04:10 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.