Jump to content

Keeping track of a global variable


sudoinit6

Recommended Posts

34 minutes ago, LoudPacks said:

You can reference static variables from non-static instances.

it's still the same idea....

void thisIsDumb(){

 if(Main.badDesign){

  ...

 }

}

 

If u wanna share, just use get/set(multiple class). If u wanna make something public static, make sure it's immutable. If it's just within the same class.. public anything will do l0l

btw-- I c what u mean, i don messed up. But uh yea, no point having static if it's within the same class and if not then^

Edited by dreameo
Link to comment
Share on other sites

1 hour ago, dreameo said:

it's still the same idea....

void thisIsDumb(){

 if(Main.badDesign){

  ...

 }

}

 

If u wanna share, just use get/set(multiple class). If u wanna make something public static, make sure it's immutable. If it's just within the same class.. public anything will do l0l

btw-- I c what u mean, i don messed up. But uh yea, no point having static if it's within the same class and if not then^

Yea it really depends on what you're trying to do. No point in using static vars / methods if you don't need to. I was just generalizing.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...