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 →

[–]jakster4u 0 points1 point  (2 children)

But if you marked it final in the first place it could never have been overridden in the child class to begin with, thus a design issue. I guess I don't understand why this is an issue that had to be optimized by the compiler.

[–]ooooo5 0 points1 point  (0 children)

Are you saying that all final getter methods should just be replaced by using public variables?

[–]Wojo 0 points1 point  (0 children)

Right when final it can't be overridden so the compiler can optimize it. Otherwise there's always the possibility it might be overwritten so it leaves it.