1:重载overload;procedure MyShowMessage(S : string) ;overload;
begin
  ShowMessage(S);
end;procedure MyShowMessage(I : Integer);overload;
begin
  ShowMessage(IntToStr(I));
end;楼主自己复制一下上面的,然后自己调用这个过程就明白了

解决方案 »

  1.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;type
      TForm1 = class(TForm)
        Button1: TButton;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;type
      TParent = class
      public
        procedure MyShowMessage;virtual;
      end;  TChild = class
      public
        procedure MyShowMessage;virtual;
      end;var
      Form1: TForm1;implementation{$R *.dfm}
    { TParent }procedure TParent.MyShowMessage;
    begin
      ShowMessage('Parent');
    end;{ TChild }procedure TChild.MyShowMessage;
    begin
      ShowMessage('Child');
    end;procedure TForm1.Button1Click(Sender: TObject);
    var
      P : TParent;
      c : TChild;
    begin
      P := TParent.Create;
      C := TChild.Create;  P.MyShowMessage;
      C.MyShowMessage;  P.Free;
      C.Free;
    end;end.
      

  2.   

    改一下:
    TChild = class
      public
        procedure MyShowMessage;override;
      end
      

  3.   

    TChild = class (TParent)
      public
        procedure MyShowMessage;override;
      end;还是错了,我今天怎么了,汗
      

  4.   

    override 是把原来的方法扩充。
    就象:你的程序还是你的程序,但是扩充之后你会增加新的功能。
    overload 是把原来的方法覆盖。原来的方法没有了,只剩下新的方法。
    就象:你的程序全部删掉了,又弄了一个新程序。以上之后在继承的时候才用。override所作用的方法必须是虚方法(virtual)不知道我说对不对。。哈哈~~~可能完全弄反了。。