+ 1

Why there's a need of declaring default constructor in java classes?

18th Mar 2017, 9:09 AM
laiba malick
laiba malick - avatar
3 Answers
+ 1
thanks
27th Mar 2017, 1:42 AM
laiba malick
laiba malick - avatar
0
constructors are useful since, you cannot initialize values of data in a class since it is a blueprint and not an object itself. initialising using constructors is the only way out of not using many methods and lots of code for the same purpose
18th Mar 2017, 12:54 PM
Puspal Ghosh
Puspal Ghosh - avatar
0
You don't, butit can be useful to define a default constructor for cases that you need the methods but not any of the vvariables or whatnot
26th Mar 2017, 7:56 PM
Logan New
Logan New - avatar