constructor should be declared in public section.No return type can be specified for constructors. Not even void type can be specified for return type in constructor. So constructor can't return values.Constructors are invoked automatically when objects are created.
Java
Topic: Constructors
What are Characteristics of constructor:?
Browse random answers:
What is the difference between a constructor and a method?
Why constructor does not have return type in java?
Where and how can you use a private constructor?
What are Characteristics of constructor:?
What is Parameterized constructor?
What is copy constructor?
What is Default constructor ?
What is Dynamic constructor ?
How should a contructor handle a failure?
What is virtual constructors/destructors?