Why it's called methods? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Why it's called methods?

5th May 2018, 5:13 AM
Tanmoy Mohajan
Tanmoy Mohajan - avatar
4 Answers
5th May 2018, 8:23 AM
Burey
Burey - avatar
+ 1
just for distinction whit OOP I think
5th May 2018, 5:16 AM
Viryl15
Viryl15 - avatar
+ 1
Hi Tannoy the difference with a Method, is that it is always associated with a set of data ( or state) encapsulated with it. You call the method to operate on the data and nothing else. Together the data and the method make an Object. This allows you to build code that has a separation of concerns, and makes it more manageable and maintainable
5th May 2018, 6:56 AM
Mike Choy
Mike Choy - avatar
+ 1
they are the block of statements which define the behavior of the object.
6th May 2018, 10:39 AM
ashish patjoshi
ashish patjoshi - avatar