Home  |  Delphi .net Home  |  System.Object  |  Equals Method
  
Equals  
Method  
Returns true if one object equals another
Object Class
System NameSpace
CF1.  Function Equals ( Target : Object ) : Boolean;
CF2.  Function Equals ( ValueA : Object; ValueB : Object ) : Boolean; Static;
CF : Methods with this mark are Compact Framework Compatible
Description
Returns true if the current Object value exactly matches the Target Object value. Otherwise false.
 
Or if ValueA matches ValueB.
 
Normally, the 1st syntax is meaningful only in inherited classes, whereas the latter is usable by all class types.
Notes
Static methods are not methods of an object - they are simply class functions or procedures available at any time.
Microsoft MSDN Links
System
System.Object
 Author links

 Buy Website Traffic at
 Buywebsitetrafficexperts.com

 Buy Proxies at
 Buyproxies.io
 
 
 
A simple example
program Project1;
{$APPTYPE CONSOLE}

var
  str1, str2 : String;

begin
  str1 := 'Delphi';
  str2 := 'Basics';

  if System.Object.Equals(str1, str2)
  then Console.WriteLine(str1 + '  = ' + str2)
  else Console.WriteLine(str1 + ' <> ' + str2);

  if System.Object.Equals(str1, str1)
  then Console.WriteLine(str1 + '  = ' + str1)
  else Console.WriteLine(str1 + ' <> ' + str1);

  Console.ReadLine;
end.
   Delphi <> Basics
   Delphi  = Delphi
 
 
Delphi Programming Neil Moffatt 2002 - 2017. All rights reserved.  |  Contact the author