Our website is made possible by displaying online advertisements to our visitors.Please consider supporting us by disabling your ad blocker.
Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu
Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Translate it in your own Language

Print this Job Post

Print Friendly and PDF

Monday, May 26, 2014

Core Java – OOPs Concepts: Constructor Interview Questions

Question-15: What is constructor?
Constructor is just like a method that is used to initialize the state of an object. It is invoked at the time of object creation.

Question-16: What is the purpose of default constructor?
The default constructor provides the default values to the objects. The java compiler creates a default constructor only if there is no constructor in the class.

Questiom-17: Does constructor return any value?
yes, that is current instance (You cannot use return type yet it returns a value).

Question-18: Is constructor inherited?
No, constructor is not inherited.

Question-19: Can you make a constructor final?
No, constructor can’t be final.

Core Java – OOPs Concepts: static keyword Interview Questions

No comments:

Post a Comment

Copyright @ CrackMNC 2014-2024
Divas Nikhra Theme by Crack MNC