functions have independent existence means they are defined outside of the class e.g. in c main() is a function while methods do not have independent existence they are always defined inside class e.g. main() in Java is called method.
########
I've been studying OOP lately and had this question myself, so I will share my thoughts;
I was taught that "A Function should do 1(one) thing and do it well."
In specific Regards to PHP;
The difference between a Method and a Function is that a Method is tied to a specific class.
Hope this helps.
--------------------------------------------------------------------------------------------------------
function can return value where as method can't that is the main difference between function and method
---------------------------------------------------------------------------------------------------
Actually you are describing the difference between a function and a procedure. Function returns a value, procedure does not unless you are using c#, then everything is a function.
In c# a function, to paraphrase the first answer, does and thing and does it well. A method contains functions. The most important method is the Main method. All functionality of a program must be referenced in the Main method because when you run a program, it starts at the beginning of the Main method, and stops wehn it hits end of the Main method.
functions and methods refer to the same thing in Java so they do not have any differences. They are bits of code in java which have a name and can take a bunch of parameters and do a certain function. This code can be invoked by using the name. some people use the name functions and some use the name methods but both refer to the same with respect to the java programming language.
what is difference between regular simplex method and dual simplex method
fundamental difference between a polynomial function and an exponential function?
Differentiate between work study and method study.
scientific is science and unscientific method is not scientific
This function will accept two parameters and return the difference between the first and second parameter. function diffBetween ( a, b ) { return a-b; } //end diffBetween
A function is a piece of code that can be reused by calling its name while a method is a function that is associated with a class. In Java, functions are usually referred to as static methods.
What is the difference between the conventional method of dimensioning and the baseline method of dimension
Difference between Percentage of Completion method and Completed Contract method?
what is difference between regular simplex method and dual simplex method
what is the difference between roster method and rule method
fundamental difference between a polynomial function and an exponential function?
In object-oriented languages, a class member function is also known as a method. C does not provide native support for the object-oriented paradigm and therefore does not support methods.
What is the difference between Modified accrual and Full accrual method?"
A wye is a back function of the piping which carries loads of water into your home. It is a great method for smoking da ganj.
ice baby
differences between direct method and grammar translation?
A constructor is a method that fires when the object is instantiated. A friend function is a function that has special access to the object. They are two different types of things, and cannot be further differenced.