"A constructor cannot be abstract, static, final, native, or synchronized."
I understand on why it can't be all of the above, except "final". why can't we have a final constructor, i understand constructors are not inherited, hence no chance/case of overriding etc. But why is it not allowed at all ?
I understand constructors can not be inherited etc., why i had asked this question was to ask this itself, is the reason only "doesn't make sense to be final" or is there some design/OOPS implications of allowing constructors to be final.
Looks like the only reason is "doesn't make sense to be final". Doesn't satisfy my quest though ! sigh !
So, while you technically COULD allow it, it would cause more confusion. Somebody would come along and say "THIS constructor is final, but THAT one isn't... what's the difference?" and spend time trying to figure it out.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Originally posted by Campbell Ritchie: Isn't "Doesn't make sense" a good reason for it?
Not for private methods, obviously...
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus