Applied Microsoft .NET Framework Programming Beatrice NE

Jeffrey Richter provides chapter 6, 'Common Object Operations,' from his new book, Applied Microsoft .NET Framework Programming.

Local Companies

J & L Electronics Inc
(402) 228-2763
620 Court St
Beatrice, NE
Comptech
(402) 462-5530
714 W 2nd St
Hastings, NE
Dit Computers
(402) 292-8018
2904 S 180th St
Omaha, NE
Best Buy
(402) 289-5389
333 N 170th St
Elkhorn, NE
Swiftlink Communications
(402) 245-2878
1721 Stone St
Falls City, NE
Nick J Computer Doctor
(402) 239-8329
402 Court St
Beatrice, NE
Network Consulting Services
(402) 228-4040
117 N 5th St
Beatrice, NE
Computers by Malone
(402) 333-6783
12231 Emmet St
Omaha, NE
Comcor Enterprises Inc
(402) 572-4356
8111 Vernon Ave
Omaha, NE
Quick Connect Computer Services
(402) 434-2828
233 N 48th St Ste P
Lincoln, NE

provided by: 
Originally published at Internet.com


The following is extracted from the book Applied Microsoft .NET Framework Programming by Jeffrey Richter (Microsoft Press, 2002, ISBN: 0-7356-1422-9). Copyright 2002, Jeffrey Richter. Reproduced by permission of Microsoft Press. All rights reserved. -----------------------------------

Common Object Operations



In this chapter, I'll describe how to properly implement the operations that all objects must exhibit. Specifically, I'll talk about object equality, identity, hash codes, and cloning.

Object Equality and Identity



The System.Object type offers a virtual method, named Equals, whose purpose is to return true if two objects have the same "value". The .NET Framework Class Library (FCL) includes many methods, such as System.Array's IndexOf method and System.Collections.ArrayList's Contains method, that internally call Equals. Because Equals is defined by Object and because every type is ultimately derived from Object, every instance of every type offers the Equals method. For types that don't explicitly override Equals, the implementation provided by Object (or the nearest base class that overrides Equals) is inherited. The following code shows how System.Object's Equals method is essentially implemented: class Object { public virtual Boolean Equals(Object obj) { // If both references point to the same // object, they must be equal. if (this == obj) return(true); // Assume that the objects are not equal. return(false); } ' } ...

Read article at Internet.com site

Featured Local Company

Brads PC Repair

402-477-4105
2935 Pine Lake Rd
Lincoln, NE


Topics: 
Architecture & Design Languages & Tools Project Management Web Services
Database Microsoft & .NET Security Wireless
Java Open Source Techniques XML