Delphi tstream: weird creation behavior

I am new to Delphi. In the documentation for the TStrem class, I read that it is an abstract class. So I think the compiler is wrong when I try to create it with

stream := TStream.Create();

Why not?

+4
source share
1 answer

The Delphi language does not actually have a formal concept of an abstract class.

It is true that you can define a class as abstract:

type
  TMyClass = class abstract
  end;

But you can create an instance of this class. In fact, class abstractin Delphi it is a function used only by the long-abandoned Delphi.net compiler.

- , abstract. , . , .

TStream , , "" . abstract, .

, TStream . , GetSize, SetSize, Read, Write Seek abstract. , , abstract , , .

TStream - , , Delphi RTL. , . , , . .

+7

Source: https://habr.com/ru/post/1679879/


All Articles