Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Isn't a method just a function having an object as first parameter.

Differences:

- Methods must be defined in the same package as the receiver.

- Methods can be used to implement interfaces.

- Methods can be discovered dynamically by inspecting the type of the receiver (either through reflection or with a dynamic cast).



Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: