0
should constructor be defined in public?
same with question!
2 Antworten
+ 1
They can be declared private or protect for the purpose of preventing access to (certain) constructors. This is useful, if you want to control who is able to create an instance of your class.
0
not necessary.only constructor has to be declared in public.but they can also be defined outside the class too.