Can you make a constructor final?
I'll answer
Earn 20 gold coins for an accepted answer.20
Earn 20 gold coins for an accepted answer.
40more
40more
Studied at the University of Melbourne, Lives in Melbourne, Australia.
So making a constructor final is not required, so it is not used with constructor. When you set a method as final, it means : "You don't want any class override it", but constructor by JLS definition can't overridden,so it is clean. We can't make constructor to be final because constructor is never inherited.
2023-05-05 12:30:28
评论(499)
Helpful(122)
Helpful
Helpful(2)

Charlotte Harris
QuesHub.com delivers expert answers and knowledge to you.
So making a constructor final is not required, so it is not used with constructor. When you set a method as final, it means : "You don't want any class override it", but constructor by JLS definition can't overridden,so it is clean. We can't make constructor to be final because constructor is never inherited.