Skip to content

Instantly share code, notes, and snippets.

@rmg007
Created October 3, 2022 20:43
Show Gist options
  • Save rmg007/edcef86b2a0e438ab6aa70ebfb20602e to your computer and use it in GitHub Desktop.
Save rmg007/edcef86b2a0e438ab6aa70ebfb20602e to your computer and use it in GitHub Desktop.
learn and dive deep into Java Course. introduction to variables lecture
public class Main {
// instance variable
int myAge = 29;
// static/class variables
static int salary = 90000;
public static void main(String[] args) {
// local variable
int age; // declared variable of type int, variable name is "age"
age = 26; // variable assignment
int myAge2 = 26;
System.out.println(age);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment