+ 6
Java challenge question
Please, explain why In Java challenge there is a question "Constructor can be private" The right answer is true. How could it be?
7 odpowiedzi
+ 16
Constructor modifiers (public, protected, private), follow the same rules as normal methods, except that an 'abstract' , 'static' or 'final' constructor is not allowed.
+ 10
Class will be private , so constructor will be private, In google there are lot of example here.
+ 7
~ swim ~ what is the main advantage of a singleton class over static classes?
+ 6
Julia this should help
https://code.sololearn.com/cnUdTWuHTzkU/?ref=app
+ 5
Constructors can be private, instatiating objects of classes with private constructors would require the use of a static method