Like fields, methods are also inherited from ancestor classes. However, while method inheritance can be as simple as field inheritance, it is often much more sophisticated as shown below:
type
  TShape = class(TObject)
    X,Y : Double;
    function Area : Double; virtual; abstract;
  end;

type
  TRectangle = class(TShape)
    Width,Height : Double;
    function Area : Double; override;
  end;

type
  TCircle = class(TShape)
    function Area : Double; override;
  end;

function TRectangle.Area : Double;
begin
  Result := Width*Height;
end;

function TCircle.Area : Double;
begin
  Result := 3.14159*Radius*Radius;
end;
The method Area is defined in TShape as an abstract method. An abstract method has no implementation. In other words, the Area in TShape is more of an idea. It represents the idea of calculating the area, but does not define explicitly how to do it. When Area is overridden in TRectangle and TCircle, we are required to implement it. We do so in TRectangle.Area and TCircle.Area. Notice that the implementations are different (obviously since finding the area of a rectangle is different than finding the area of a circle). The usefulness of this technique will begin to become apparent in the following code.
var
  Shape : TShape;
  Rect : TRectangle;
  Circle : TCircle;
  List : TList;
  K : Integer;
begin
  List := TList.Create;

  Circle := TCircle.Create;
  Circle.Radius := 5;
  List.Add(Circle);

  Rect := TRectangle.Create;
  Rect.Width := 10;
  Rect.Height := 5;
  List.Add(Rect);

  Circle := TCircle.Create;
  Circle.Radius := 8;
  List.Add(Circle);

  Circle := TCircle.Create;
  Circle.Radius := 2;
  List.Add(Circle);

  Rect := TRectangle.Create;
  Rect.Width := 4;
  Rect.Height := 6;
  List.Add(Rect);

  For K := 0 to List.Count-1 do
    Writeln(TShape(List[K]).Area);
end.
In most of the code above, objects are simply created and added to a list. What is important is the loop at the bottom. This loop writes the areas of all the shapes to the screen. Notice that we do not have to know whether or not the shape in the list is a rectangle or a circle. Since we defined Area as an abstract method in the abstract base class TShape and then overrode it in TRectangle and TCircle, Object Pascal automatically picks the correct Area method to call at runtime. This is known as polymorphism and is one of the most poweful features of object-oriented programming. By combining abstraction and polymorphism one can create logical heirarchies of classes which can be handled by the same code regardless of how many subclasses are implemented. For example, say we create a new class called TSquare:
type
  TSquare = class(TShape)
    Side : Double;
    function Area : Double; override;
  end;

function TSquare.Area : Double;
begin
  Result := Side*Side;
end;
If we added a TSquare object to the list, the following code would still work without any changes:
For K := 0 to List.Count-1 do
    Writeln(TShape(List[K]).Area);