[haXe] Abstract Classes?

Nicolas Cannasse ncannasse at motion-twin.com
Mon Nov 6 09:28:17 CET 2006


> Hi,
> 
> Is it somehow possible to declare abstract classes in haxe? Have I missed  
> something obvious, or is that feature not implemented in haxe?
> 
> / Rickard

There is no abstract classes in haXe, but you can define a private
constructor. This way, such a class can't be constructed. Only
subclasses might define a public constructor.

There is no abstract method either, so you need to define an empty body
(or maybe throw an exception) in the main class. These functions will be
overridden in subclasses.

Nicolas



More information about the Haxe mailing list