델피의 클래스 이해(11) - 클래스에 깊이 들어가는 방법[8] - 추상적 방법과 추상적 클래스

1454 단어 Delphi


//         ;          Delphi             ;            .



{            }

TMyClass = class(TObject)

  procedure Proc1; virtual; abstract;      {                   }

  function Fun: string; dynamic; abstract; {          }

end;



{

              、    ;

              .



              ,             ;

                ,         .



               TStrings  ,   :

}

var

  List: TStrings;

  i: Integer;

begin

  List := TStringList.Create;



  for i := 0 to 99 do List.Add(IntToStr(i));



  Memo1.Lines := List;



  List.Free;

end;



{ 

  TStrings          ,             TStringList        ;

    ,          TStrings     ,      TStringList    .



         ,        TStringList    ?         ?

      :       "  "    ;

         Memo1.Lines      TStrings    ,           .     :

}

//        

var

  List: TStringList; {      List: TStrings      }

begin

  List := TStringList.Create;



  List := Memo1.Lines; {      }



  List.Free;

end;


 
   
// Delphi 7 , . { class abstract , :} TBass = class abstract(TObject) procedure Proc; function Fun: string; virtual; abstract; end; { , , class abstract , :} TBass = class abstract(TObject) procedure Proc; function Fun: string; end; { } TBass = class(TObject) procedure Proc; function Fun: string; end; { !}

좋은 웹페이지 즐겨찾기