What will happen if we make the constructor private ?

Search Interview Questions

 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text


Interview Questions and Answers

 Q1. What will happen if we make the constructor private ?Core Java
Ans. We can't create the objects directly by invoking new operator.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   oops   constructor   access specifier   private     Asked in 1 Companies      basic

Try 2 Question(s) Test

Related Questions

  What are points to consider in terms of access modifier when we are overriding any method?
  Difference between Public, Private, Default and Protected ?
  Which access specifiers can be used with top level class ? a. public or default b. public or private c. public or protected d. protected or default
  Which access specifier can be used with Class ?
  Can we reduce the visibility of the inherited or overridden method ?
  Can we instantiate the object of derived class if parent constructor is protected ?
  Can we declare an abstract method private ?
 What access the variable gets if we don't provide any access specifier ?
  Can we reduce the visibility of the overridden method ?

Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: