Program PNestedType;

{$APPTYPE CONSOLE}

uses
  System,
  Borland.Delphi.Classes,
  Borland.Delphi.SysUtils;
type
  TMyClass = class
    Fdata: Integer;
    type TNestedClass = class
      procedure Hello;
    end;
    procedure Green;
  end;

procedure TMyClass.Green;
begin
  Console.WriteLine('TMyClass.Green');
end;


procedure TMyClass.TNestedClass.Hello;
begin
  Console.WriteLine('Hello From TMyClass.TNestedClass');
end;

var
  MyClass : TMyClass;
  MyNest: TMyClass.TNestedClass;
begin
  MyClass.Fdata := 15;
  MyNest.TNestedClass := TMyClass.TNestedClass.Create;
  MyNest.Hello;
  MyClass.Green;
end.
