Can a constructor be protected?



Can a constructor be protected?..

Answer / Shiv Ram Verma

No, in Java, constructors cannot be declared with an access modifier (such as protected or private). By default, constructors have the same access level as their enclosing class.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is polymorphism in java? What are the kinds of polymorphism?

1 Answers  


Can you call a method on a null object?

1 Answers  


What is java virtual machine? Explain

1 Answers  


What is package protected in java?

1 Answers  


What is prefix of a string?

1 Answers  


What are singleton services?

1 Answers  


what is thread in Java ?

1 Answers  


What is the difference between the boolean & operator and the && operator in java programming?

1 Answers  


What is the benefit of lambda expressions?

1 Answers  


What is integer parseint?

1 Answers  


What is field name?

1 Answers  


What is the purpose of javac exe?

1 Answers  


Categories