{"id":246265,"date":"2014-12-20T00:27:03","date_gmt":"2014-12-19T20:27:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=246265"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=246265","title":{"rendered":"<span class=\"post_title\">\u0421# \u0434\u043b\u044f AS3 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432. \u0427\u0430\u0441\u0442\u044c 2: \u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432<\/span>"},"content":{"rendered":"<div class=\"content html_format\">       <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/de5\/d30\/978\/de5d309782338218af5ea4a8412f838b.png\" alt=\"image\"\/><\/p>\n<p>  <i>\u041f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/jacksondunstan.com\/articles\/2703\">From AS3 to C#, Part 2: Extending Classes and Implementing Interfaces<\/a><\/i><\/p>\n<p>  \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0441\u0435\u0440\u0438\u044e &quot;<a href=\"http:\/\/habrahabr.ru\/post\/246161\/\">C# \u0434\u043b\u044f AS3 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432<\/a>&quot;, \u0438 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0432 C# \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f AS3 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 (\u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0438 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432).<br \/>  <a name=\"habracut\"><\/a><br \/>  \u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u043e\u0432. \u0412\u043e\u0442, \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 AS3:<\/p>\n<pre><code class=\"actionscript\">class Shape { }   class Circle extends Shape { } <\/code><\/pre>\n<p>  \u0410 \u0432\u043e\u0442, \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442\u044c \u0432 C#:<\/p>\n<pre><code class=\"cs\">class Shape { }   class Circle : Shape { } <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0432\u043c\u0435\u0441\u0442\u043e \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 extends, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f: (\u0434\u0432\u043e\u0435\u0442\u043e\u0447\u0438\u0435).<\/p>\n<p>  \u041f\u043e\u0445\u043e\u0436\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043e\u0431\u0441\u0442\u043e\u044f\u0442 \u0434\u0435\u043b\u0430 \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432. \u041a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 AS3:<\/p>\n<pre><code class=\"actionscript\">interface IHasArea {     function GetArea(): int; }   interface IRound {     function GetSmoothness(): int; }   class Shape { }   class Circle extends Shape implements IHasArea, IRound {     function GetArea(): int     {         return 33; \/\/ TODO \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044c     }       function GetSmoothness(): int     {         return 44; \/\/ TODO \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044c     } } <\/code><\/pre>\n<p>  \u0422\u0430 \u0436\u0435 \u0441\u0430\u043c\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043a\u043e\u0434\u0430, \u043d\u043e \u0432 C#:<\/p>\n<pre><code class=\"cs\">interface IHasArea {     int GetArea(); }   interface IRound {     int GetSmoothness(); }   class Shape { }   class Circle : Shape, IHasArea, IRound {     int GetArea()     {         return 33; \/\/ TODO \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044c     }       int GetSmoothness()     {         return 44; \/\/ TODO \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044c     } } <\/code><\/pre>\n<p>  \u0412 \u0421#, \u0434\u0432\u043e\u0435\u0442\u043e\u0447\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u043e \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 implements, \u043f\u043e \u0442\u0430\u043a\u043e\u043c\u0443 \u0436\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443, \u043a\u0430\u043a \u0438 \u0441 extends. \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0432 C# \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u043d\u044b\u0445 \u0432 AS3.<\/p>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0432 AS3:<\/p>\n<pre><code class=\"actionscript\">interface ISuper { }   interface ISub extends ISuper { } <\/code><\/pre>\n<p>  \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0432\u044b \u0443\u0436\u0435 \u0434\u043e\u0433\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0435\u0441\u044c, \u043a\u0430\u043a \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 C#\u2026<\/p>\n<pre><code class=\"cs\">interface ISuper { }   interface ISub : ISuper { } <\/code><\/pre>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f, \u043a\u0430\u043a \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c\u0438 \u0438 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u043c\u0438 \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438\/\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u043c\u0438 \u0432 C#. \u0412 AS3 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0441\u043b\u043e\u0432\u0430 this \u0438 super \u0432 \u043b\u044e\u0431\u044b\u0445 \u043d\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0443 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 (this) \u0438\u043b\u0438 \u043a \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0443 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 (super). \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"actionscript\">class Polygon {     var numVertices:uint;       function printDescription(): String     {         return &quot;Polygon (numVertices=&quot; + numVertices + &quot;)&quot;;     } }   class Triangle extends Polygon {     var color:String;     var polygonDescriptionAtConstructionTime:String;       function Triangle(color:String)     {         this.color = color;         polygonDescriptionAtConstructionTime = super.printDescription();     }       function printDescription(): String     {         return &quot;Triangle (color=&quot; + color + &quot;)&quot;;     } } <\/code><\/pre>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e super \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c \u043a\u043b\u0430\u0441\u0441\u0430 Polygon. \u0422\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u0440\u0430\u0439\u043d\u0435 \u0440\u0435\u0434\u043a\u043e, \u043d\u043e \u0438\u043d\u043e\u0433\u0434\u0430 \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0432 \u043a\u043e\u0434\u0435 \u0434\u0432\u0443\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439, \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a\u0430\u044f \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 printDescription \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d\u0430. \u0415\u0441\u043b\u0438 \u0431\u044b \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0441\u043b\u043e\u0432\u043e super, \u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u043b\u0430\u0441\u044c \u0431\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u044f printDescription \u043a\u043b\u0430\u0441\u0441\u0430 Triangle, \u0442.\u043a. \u043f\u043e\u0438\u0441\u043a \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u043a\u043b\u0430\u0441\u0441\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0440\u0430\u043d\u044c\u0448\u0435 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430.<\/p>\n<p>  \u041a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e this \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c \u043a\u043b\u0430\u0441\u0441\u0430 Triangle. \u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435, this \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u043e\u043d\u0438\u043c\u0430\u043b, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u0440\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 color \u043a\u043b\u0430\u0441\u0441\u0430 Triangle, \u0430 \u043d\u0435 \u043a \u043e\u0434\u043d\u043e\u0438\u043c\u0451\u043d\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u043e\u0439 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440.<\/p>\n<p>  \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u0435\u0440\u0441\u0438\u044f \u043d\u0430 C#:<\/p>\n<pre><code class=\"cs\">class Polygon {     uint NumVertices;       String PrintDescription()     {         return &quot;Polygon (numVertices=&quot; + numVertices + &quot;)&quot;;     } }   class Triangle : Polygon {     String Color;     String PolygonDescriptionAtConstructionTime;       Triangle(String color)     {         this.Color = color;         PolygonDescriptionAtConstructionTime = base.printDescription();     }       String printDescription()     {         return &quot;Triangle (color=&quot; + color + &quot;)&quot;;     } } <\/code><\/pre>\n<p>  \u042d\u0442\u0438 \u0434\u0432\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0438, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432 C#, \u0432\u043c\u0435\u0441\u0442\u043e \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 super, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e base. \u0412 C# base \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0442\u0435 \u0436\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0447\u0442\u043e \u0438 super \u0432 AS3.<\/p>\n<p>  \u0414\u0440\u0443\u0433\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f super \u0432 AS3 (\u0432\u044b\u0437\u043e\u0432 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430):<\/p>\n<pre><code class=\"actionscript\">class Polygon {     var numVertices:uint;       function Polygon(numVertices:uint)     {         this.numVertices = numVertices;     } }   class Triangle extends Polygon {     var color:String;       function Triangle(numVertices:uint, color:String)     {         super(numVertices);         this.color = color;     } } <\/code><\/pre>\n<p>  C# \u0432\u0435\u0440\u0441\u0438\u044f:<\/p>\n<pre><code class=\"cs\">class Polygon {     uint NumVertices;       Polygon(uint numVertices)     {         NumVertices = numVertices;     } }   class Triangle : Polygon {     String Color;       Triangle(uint numVertices, String color)         : base(numVertices)     {     } } <\/code><\/pre>\n<p>  \u041f\u043e\u043c\u0438\u043c\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043c\u044b \u0441\u043d\u043e\u0432\u0430 \u0437\u0430\u043c\u0435\u043d\u0438\u043b\u0438 super \u043d\u0430 base, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u044b\u0437\u043e\u0432 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0434\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 (\u0434\u043e \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0445 \u0441\u043a\u043e\u0431\u043e\u043a {}). \u0422\u0430\u043a \u0436\u0435, \u0432\u044b\u0437\u043e\u0432\u0443 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u043f\u0440\u0435\u0434\u0448\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0432\u043e\u0435\u0442\u043e\u0447\u0438\u0435 (:). \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432\u044b\u0437\u043e\u0432\u0430, \u043d\u0435 \u0441\u0442\u0430\u0432\u0438\u0442\u0441\u044f \u0442\u043e\u0447\u043a\u0430 \u0441 \u0437\u0430\u043f\u044f\u0442\u043e\u0439 (;).<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c, \u043a\u0430\u043a \u0432 AS3 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043a\u043b\u0430\u0441\u0441 \u043d\u0435\u043b\u044c\u0437\u044f \u0431\u044b\u043b\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c:<\/p>\n<pre><code class=\"actionscript\">final class FinalClass { }   \/\/ \u042d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f class DerviedClass extends FinalClass { } <\/code><\/pre>\n<p>  \u041f\u043e\u0445\u043e\u0436\u0438\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0432 C#:<\/p>\n<pre><code class=\"cs\">sealed class FinalClass { }   \/\/ \u042d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f class DerviedClass : FinalClass { } <\/code><\/pre>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u043c\u0435\u0436\u0434\u0443 C# \u0438 AS3 \u0441\u043e\u0441\u0442\u043e\u044f\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0438 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u0441\u043b\u043e\u0432. \u0412 C# \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u044b\u0440\u0439 \u043d\u0435\u043b\u044c\u0437\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442\u0441\u044f \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c \u0441\u043b\u043e\u0432\u043e\u043c sealed, \u0430 \u0432 AS3 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f final, \u043d\u043e \u044d\u0444\u0444\u0435\u043a\u0442 \u2014 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439.<\/p>\n<p>  \u0412 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438, \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 C# \u0438 AS3 \u043a\u043e\u0434\u0430:  <\/p>\n<table>\n<tr>\n<td>\n<pre><code class=\"cs\">\/\/\/\/\/\/\/\/ \/\/ C# \/\/ \/\/\/\/\/\/\/\/   \/\/ Interface interface IShape {     String GetDescription(); }   \/\/ Sub-interface (one that extends another) interface IPolygon : IShape {     uint GetNumEdges(); }   \/\/ Class class Shape {     String Name;       Shape(String name)     {         Name = name;     } }   \/\/ Derived class (one that extends another) class Circle : Shape {     int Radius;       Circle(String name, int radius)         : base(name)     {         Radius = radius;     } }   \/\/ Derived class that also implements an interface class Triangle : Shape, IPolygon {     Triangle()         : base(&quot;Triangle&quot;)     {     }       uint GetNumEdges()     {         return 3;     }       String GetDescription()     {         return &quot;A three-sided polygon&quot;;     } }   \/\/ Class that can't be extended sealed class NoDerivatives { } <\/code><\/pre>\n<p>  <\/td>\n<td>\n<pre><code class=\"actionscript\">\/\/\/\/\/\/\/\/\/ \/\/ AS3 \/\/ \/\/\/\/\/\/\/\/\/   \/\/ Interface interface IShape {     function getDescription(): String; }   \/\/ Sub-interface (one that extends another) interface IPolygon extends IShape {     function getNumEdges(): uint; }   \/\/ Class class Shape {     var name:String;       function Shape(name:String)     {         this.name = name;     } }   \/\/ Derived class (one that extends another) class Circle extends Shape {     var Radius:int;       function Circle(name:String, radius:int)     {         super(name);         Radius = radius;     } }   \/\/ Derived class that also implements an interface class Triangle extends Shape implements IPolygon {     function Triangle()     {         super(&quot;Triangle&quot;);     }       function GetNumEdges(): uint     {         return 3;     }       function GetDescription(): String     {         return &quot;A three-sided polygon&quot;;     } }   \/\/ Class that can't be extended final class NoDerivatives { } <\/code><\/pre>\n<p>  <\/td>\n<\/tr>\n<\/table>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u043c\u044b \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0437\u0430\u043a\u0440\u0443\u0433\u043b\u044f\u0435\u043c\u0441\u044f. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0433\u0435\u0442\u0442\u0435\u0440\u0430\u0445 \u0438 \u0441\u0435\u0442\u0442\u0435\u0440\u0430\u0445 (getter\/setter) \u0438 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u0441\u043d\u043e\u0432 \u043a\u043b\u0430\u0441\u0441\u043e\u0432. \u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e, \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u043d\u044e\u0430\u043d\u0441\u0430\u043c C#, \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u0442 \u0432 AS3.   \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/246265\/\"> http:\/\/habrahabr.ru\/post\/246265\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">       <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/de5\/d30\/978\/de5d309782338218af5ea4a8412f838b.png\" alt=\"image\"\/><\/p>\n<p>  <i>\u041f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/jacksondunstan.com\/articles\/2703\">From AS3 to C#, Part 2: Extending Classes and Implementing Interfaces<\/a><\/i><\/p>\n<p>  \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0441\u0435\u0440\u0438\u044e &quot;<a href=\"http:\/\/habrahabr.ru\/post\/246161\/\">C# \u0434\u043b\u044f AS3 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432<\/a>&quot;, \u0438 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0432 C# \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f AS3 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 (\u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0438 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432).  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-246265","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/246265","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=246265"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/246265\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=246265"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=246265"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=246265"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}