+ 2
Can we override constructor in java or in any language!!
14 odpowiedzi
+ 4
@Baptiste
Isn't overriding in Java similar to the virtual functions in C++?
If yes, how are virtual constructors valid? I thought you couldn't make any...
https://stackoverflow.com/questions/733360/why-do-we-not-have-a-virtual-constructor-in-c
+ 4
As you can write it without parameter, I thought no, but it must be a misconception on my side
+ 4
@~swim~
Thats why I used the term similar, not same. And yes, thanks for pointing out the differences! I really got to know a lot more about this today.
+ 3
In C++ and python you can. I think C# also
I do not know for Java though but I think you can
+ 3
Hum, I did not think of overriding this way but yes you are right
I thought of it as overriding the default one there is when you do not make it yourself
+ 3
@Baptiste
Isn't that 'overloading' ?
+ 1
can't override in java
0
why? explanation??
0
Constructor looks like a method but name should be as class name and no return value.