Skip to content

Instantly share code, notes, and snippets.

@TheShubhamVsnv
Last active January 17, 2024 15:03
Show Gist options
  • Save TheShubhamVsnv/4ec96cdf0cc20520ddbc93bf5aa52157 to your computer and use it in GitHub Desktop.
Save TheShubhamVsnv/4ec96cdf0cc20520ddbc93bf5aa52157 to your computer and use it in GitHub Desktop.
/*
Static is used with variables and methods to make them belong to the class rather than an instance
of the class. Static members are shared among all instances of a class and can be accessed without
creating an instance of the class.
*/
public class MyStaticClass {
public static Integer myStaticVariable;
public static void myStaticMethod() {
// Code logic shared by all instances!
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment