0

why use contractor in method overriding

1st Oct 2016, 5:58 PM
balram sao
balram sao - avatar
2 Antworten
+ 1
Do you mean constructor? You can override any method, not just those.
1st Oct 2016, 7:49 PM
Zen
Zen - avatar
0
It's a good idea to have a no argument constructor. You don't always want to supply an argument to a constructor. In fact, there is a design principle for classes called Java Beans where it is a requirement to have a no argument constructor. You can also create more constructors and supply them with parameters. The compiler will know which one to refer to based on the supplied parameters.
1st Oct 2016, 8:04 PM
Mythos