Explicit Constructor

What is Explicit Constructor?

Questions by rahulsweet

Showing Answers 1 - 6 of 6 Answers

Explicit constructor is actually a parameterized constructor which takes some parameters in order to create instance of a class.

E.g.       Class Sample
                      Sample  [a, b]

  Was this answer useful?  Yes

clipspiker

  • Jun 4th, 2010
 

Java objects extend Object class and hence inherit a default constructor. Thus every class can be instantiated using the default constructor. This is made possible by constructor chaining. However, it is possible to provide an alternate class constructor, that can instantiate member variables etc. This is an explicit constructor.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions