Tech Mahindra interview question

What is constructor and how is different from method