Welcome to Web-News
A Web-based News Reader
Subject Re: What does 'final' keyword exactly?
From Jarrett Billingsley <kb3ctd2@yahoo.com>
Date Sun, 5 Jun 2005 22:04:16 -0400
Newsgroups digitalmars.D

"Andrew Fedoniouk" <news@terrainformatica.com> wrote in message
news:d8081t$2bba$1@digitaldaemon.com...
> class Field
> {
> ....
>    final char[]  name()
>    {
>        return m_name;
>    }
>    final char[]  value()
>    {
>        return m_value;
>    }
> ...
> }

Makes it so you can't override that function in derived classes.

In other languages (I think C++ and Java, though it's called "sealed" in one
of them), when applied to a class, it means the class can't be derived from.
But that doesn't work in D.



Recent messages in this thread
 
-# What does 'final' keyword exactly? Andrew Fedoniouk 05-Jun-2005 09:14 pm
.-# Re: What does 'final' keyword exactly? (Current message) Jarrett Billingsley 05-Jun-2005 10:04 pm
.||# Re: What does 'final' keyword exactly? Jarrett Billingsley 05-Jun-2005 10:12 pm
.||# Re: What does 'final' keyword exactly? Andrew Fedoniouk 05-Jun-2005 10:49 pm
.|-# Re: What does 'final' keyword exactly? Andrew Fedoniouk 05-Jun-2005 11:04 pm
.|.\# Re: What does 'final' keyword exactly? Jarrett Billingsley 06-Jun-2005 11:33 am
.-# Re: What does 'final' keyword exactly? Derek Parnell 05-Jun-2005 10:03 pm
..-# Re: What does 'final' keyword exactly? Andrew Fedoniouk 05-Jun-2005 10:39 pm
...-# Re: What does 'final' keyword exactly? Derek Parnell 05-Jun-2005 11:23 pm
....\# Re: What does 'final' keyword exactly? Andrew Fedoniouk 05-Jun-2005 11:48 pm