www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - final class & final methods

reply ref2401 <refactor24 gmail.com> writes:
If I declare a class as `final` do I  have to mark all methods of 
the class as `final` too?
Sep 25 2015
next sibling parent Marco Leise <Marco.Leise gmx.de> writes:
Am Fri, 25 Sep 2015 10:28:54 +0000
schrieb ref2401 <refactor24 gmail.com>:

 If I declare a class as `final` do I  have to mark all methods of 
 the class as `final` too?
No. -- Marco
Sep 25 2015
prev sibling parent Mike Parker <aldacron gmail.com> writes:
On Friday, 25 September 2015 at 10:28:56 UTC, ref2401 wrote:
 If I declare a class as `final` do I  have to mark all methods 
 of the class as `final` too?
A final class can't be subclassed, so none of its methods can be overridden anyway.
Sep 25 2015