How constructor is different from method ?
Constructor is created with same name as that of our class and doesn't countain any return types. It is invoked after the creation of obj nd every class has a default constructor .
Where has method can be of any name it may or maynot countain a return type ..and and method can't be same as class name ..or a key word
Constructor can have a same name as a class name...
a constructor is invoked to instantiate an object with "new", reserving memory for use. a method is invoked from an instance or directly from a class if static