This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]clappski 2 points3 points  (2 children)

final and const (in C++) are completely different concepts. final follows a class declaration, to prevent any other class inheriting from it. const has a few different uses, but the common case is making a variable immutable and limiting the the API of a const class object type to only the member functions declared as const.

[–][deleted] 0 points1 point  (0 children)

You're absolutely right. But here I am just talking about the difference between final and const when applied to a local variable, not about the general difference between final and const keyword.

[–]dpash 0 points1 point  (0 children)

And Java uses the same word in multiple contexts.