On 25/01/2017 08:49, Niklas Keller wrote:
2017-01-25 9:27 GMT+01:00 Wes :
They don't belong to a class only, but to a class and all its descendants.
Ideally, descendants should not inherit constants (or anything static), but
we can't change that now, so final could make sense here. Basically, t
2017-01-25 9:27 GMT+01:00 Wes :
> They don't belong to a class only, but to a class and all its descendants.
> Ideally, descendants should not inherit constants (or anything static), but
> we can't change that now, so final could make sense here. Basically, they
> should work exactly like static f
They don't belong to a class only, but to a class and all its descendants.
Ideally, descendants should not inherit constants (or anything static), but
we can't change that now, so final could make sense here. Basically, they
should work exactly like static fields, except that static fields can be
r
Hi!
>> Given that we can now declare a class constant as public, protected, or
>> private, can we also declare them final in 7.2?
>
> That doesn't make much sense to me. Constant belongs to a class. I don't
> see much utility in "no class extending from this one can define
> constant with the sam
Hi!
> Given that we can now declare a class constant as public, protected, or
> private, can we also declare them final in 7.2?
That doesn't make much sense to me. Constant belongs to a class. I don't
see much utility in "no class extending from this one can define
constant with the same name". f
Amazing how constants are not constant :P
> On 25 Jan 2017, at 09:48, Scott Arciszewski wrote:
>
> All,
>
> Given that we can now declare a class constant as public, protected, or
> private, can we also declare them final in 7.2?
>
> https://3v4l.org/rJG0V
>
> Ideally, this code would error on line 18 rather than 15.
>
> Scott Arci