3. Difference between Constructor and Methods
1. Constructor is mainly used to initialize the instance variable.
Whereas methods is used to expose the behavior of object.
2. Constructor is implicitly invoked, whereas method is explicitly
invoked.
3. These must not be any return type in Constructor but method
must have return type.
4. Constructor name must be same as class name but method
name may be same or different.
5. Constructor is implicitly provided by java Compiler if you
don’t specify any constructor in the java class, but method is
never provided by java Compiler.