The difference between an instance variable and a static variable.
The difference between an instance variable and a static variable.
cross-posted from: https://programming.dev/post/146762
7
comments
This is a great one. I'm definitely using it in class this fall to explain static variables.
1 0 ReplyFun fact: I made this meme to explain my classmates static variables.
1 0 Reply
1 0 ReplyYoung man, could.you explain your shitpost?
0 0 Replyint variable => local scope => my int from the perspective of an instance
static int variable => class scope => our int, for all instances of a class
0 0 ReplyYou know what's funny? In PHP it's backwards :D
1 0 Reply
You've viewed 7 comments.
Scroll to top