+ 1

Why can't a constructor be final?

15th Aug 2019, 1:19 PM
Paolo De Nictolis
Paolo De Nictolis - avatar
6 Antworten
+ 3
Final member inheritance Java: https://www.sololearn.com/learn/Java/2160/
15th Aug 2019, 3:05 PM
Manual
Manual - avatar
+ 3
So a final variable means it can only be assigned 1 value a final class means that it cant be extended a final method means it cant be overridden a constructor is a special method it cant be overridden or extended only overloaded so I think it's pointless making it final wether or not its implicitly given a modifier I cant be sure.
15th Aug 2019, 3:53 PM
D_Stark
D_Stark - avatar
+ 1
Paolo De Nictolis This question is hard to understand without a description. You need to have only one Language in the tag.
15th Aug 2019, 3:04 PM
Manual
Manual - avatar
+ 1
plz a description
15th Aug 2019, 3:11 PM
Nathaniel Caridi
Nathaniel Caridi - avatar
+ 1
It's common to all three languages with different constructs, but.... In Java, why can't a constructor be final?
17th Aug 2019, 8:15 PM
Paolo De Nictolis
Paolo De Nictolis - avatar
+ 1
Construction it is supposed to be a process of object creation and objects are different. So this process makes something different each time it is called, thus it cannot be final.
18th Aug 2019, 9:43 AM
Black Winter