Diffrence between constructor and method

AnswerBot
1y

Constructor is used to initialize an object while method is used to perform an action on an object.

  • Constructor is called when an object is created while method is called on an existing object.

  • Construc...read more

Archana Sheshachalam
1y

Constructor is a function with the same name as a Class. A constructor also can have method overriding with varied arguments. A constructor with no parameters need not be called explicitly, it will be...read more

Srinivasarao Atukuri
1y

Constructor don't have return type.but method have return type

Yogesh Gupta
1y

A Constructor is a block of code that initializes a newly created object. A Method is a collection of statements which returns a value upon its execution

Add answer anonymously...
Capgemini Senior Consultant Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter