programming.dev
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
DonjonMaister to Programmer Humor@lemmy.ml · 3 年前

The difference between an instance variable and a static variable.

message-square
10
link
fedilink
  • cross-posted to:
  • programmer_humor
52

The difference between an instance variable and a static variable.

DonjonMaister to Programmer Humor@lemmy.ml · 3 年前
message-square
10
link
fedilink
  • cross-posted to:
  • programmer_humor

cross-posted from: https://programming.dev/post/146762

  • fiah@discuss.tchncs.de
    link
    fedilink
    arrow-up
    3
    ·
    3 年前

    int variable => local scope => my int from the perspective of an instance

    static int variable => class scope => our int, for all instances of a class

    • Bear_with_a_hammer@lemmy.mlBanned
      link
      fedilink
      arrow-up
      2
      ·
      3 年前

      You know what’s funny? In PHP it’s backwards :D

      • fiah@discuss.tchncs.de
        link
        fedilink
        arrow-up
        2
        ·
        3 年前

        well of course it is!

Programmer Humor@lemmy.ml

programmerhumor@lemmy.ml

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: [email protected]

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 3 users / day
  • 43 users / week
  • 1.21K users / month
  • 5.61K users / 6 months
  • 849 local subscribers
  • 42K subscribers
  • 2.03K Posts
  • 41.6K Comments
  • Modlog
  • mods:
  • AgreeableLandscape@lemmy.mldeleted by creator
  • cat_programmer@lemmy.ml
  • BE: 0.19.18
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org