Functions are independent and can exist on their own, methods exist only inside a class.
A method (noun) is a way of doing something: IE a series of actions that achieve a result.
Function has several meanings - the one I think you're after is 'to function' (verb) which simply means 'to work'.
The difference between a Method and a Function is that a Method is tied to a specific class. 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.
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.
A method or a procedure need not have to return a value. A function returns a value even void. the function term comes from the mathematical definition y=f(x), and a method is a block where some sequential steps have been performed to achieve a task.
by Shane6 years ago
What is the difference between Kidney Cyst and Kidney Stones ?is there pain involved in either both of them ?I'm getting pain always in my left kidney.
by Ciel Clark5 years ago
What's the difference between a robot and a machine?
by Grace Marguerite Williams22 months ago
What IS the difference between the UPPER LOWER & LOWER MIDDLE CLASS, if any?Can the lower middle class be deemed as a somewhat upscale lower class?
by Charlu4 months ago
Can you tell the difference between a real cowboy and a wanna be cowboy? If so tell me how.Is it when their boots cost more than their trucks or what's under them boots that counts? Could it be in the way they walk from...
by Ishwaryaa Dhandapani5 years ago
What is the difference between a patty and a cutlet?
by Ari Lamstein5 years ago
What's the difference between Rally, Agility and Obedience dog competitions?Agilitymach, I loved reading your Hubs about competing in agility competitions with your dog. I've recently heard about "rally"...
Copyright © 2018 HubPages Inc. and respective owners.
Other product and company names shown may be trademarks of their respective owners.
HubPages® is a registered Service Mark of HubPages, Inc.
HubPages and Hubbers (authors) may earn revenue on this page based on affiliate relationships and advertisements with partners including Amazon, Google, and others.