Computer Science, asked by Mrlnnovative, 1 month ago

Distinguish between constructor and method​

Answers

Answered by MsQueen6
4

Wind erosion is significant in arid and semi-arid regions. In regions with heavy rainfall and steep slopes, erosion by running water is more significant. ... Gullies deepen with rainfall, cut the agricultural lands into small fragments and make them unfit for cultivation.

Answered by Ᏸυէէєɾϝɭყ
7

Answer:

The difference between constructor and method is:

Constructor

  • Constructor is used for initializing the ínstance of any class.
  • It does not have any return type
  • The constructor name must be the same as a class name.
  • It calls automatically when you create a class object.
  • There is a default constructor which is provided by the compiler.

Method

  • Method is used to perform some operation or function.
  • It has a return type.
  • The name of the method can be the same or different as per need.
  • You need to call the method explicitly.
  • There is no method provided by the compiler.

Similar questions