Sealed classes and methods: Difference between revisions
Content added Content deleted
Line 27: | Line 27: | ||
In Phix, "private" determines availability from outside [sub-]class code, but there is nothing at all to prevent Child from |
In Phix, "private" determines availability from outside [sub-]class code, but there is nothing at all to prevent Child from |
||
having a public method that (internally) invokes a private method of the Parent, and of course/not unlike it would make no difference were name and age made private below.<br> |
having a public method that (internally) invokes a private method of the Parent, and of course/not unlike it would make no difference were name and age made private below.<br> |
||
The Phix compiler can make exactly the same optimisations were it to spot at EOF that a |
The Phix compiler can make exactly the same optimisations were it to spot at EOF that a method was not overidden as it could were it told up-front. |
||
as it could were it told up-front. |
|||
{{trans|Wren}} |
{{trans|Wren}} |
||
Extended to include an under-age parent |
Extended to include an under-age parent |