Created
October 3, 2022 20:43
-
-
Save rmg007/edcef86b2a0e438ab6aa70ebfb20602e to your computer and use it in GitHub Desktop.
learn and dive deep into Java Course. introduction to variables lecture
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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