Satya Dash’s Post

Functions vs Methods in Programming Function: standalone lines of code 👩💻 to perform certain task independently without an associated object. You can directly call ☎️ a function, pass arguments if required and it operates on the data. Method: is a function that is associated to an object or a class in object oriented programming (OOP). Methods are called on objevt using dot notation: object.method() -> the method have access to the data associated with the instance of the object invoked during the runtime🏃♂️ Key 🔐 Differences: 🎯Function are independent and can be called by their name anywhere. 🎯Methods are always associated with an object and are called using objects. 🎯Methods are specific and internal to objects, however functions are general-purpose. picture: https://lnkd.in/d9C5Rs6s

  • diagram, text, application

To view or add a comment, sign in

Explore content categories