Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Java Objects (Retired) Harnessing the Power of Objects Helper Methods and Conditionals

functions

What's the difference between a method and an function?

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi! This is a very common question. Just like all thumbs are fingers but not all fingers are thumbs. The same principle applies here. All methods are functions but not all functions are methods. The term "method" is used when we're specifically talking about a function that's defined inside a class. Thus that "method" can be run on an instance of an object.

Hope this helps! :sparkles:

thx

Chris Tvedt
Chris Tvedt
3,795 Points

Could you make some examples to explain this? On example with a function that is a method and another function that is not? :)