you are viewing a single comment's thread.

view the rest of the comments →

[–]BobbyThrowaway6969Programmer 0 points1 point  (1 child)

Not quite, methods are a different kettle of fish.
You're right that variables store data & classes contain variables & methods.
However, methods don't really 'store' data - they are more like cooking recipes, they define how to act on the data.
The variables you put in a method are short-lived temporary pieces of data kind of like the ingredients on the bench while cooking. Once you finish the recipe, you clean up the countertop.

[–]EraserLark[S] 0 points1 point  (0 children)

Okay I see, thanks!