Skip to content

Instantly share code, notes, and snippets.

@BraveTea
Created May 8, 2018 09:23
Show Gist options
  • Save BraveTea/ad88ffa119637c8070ea4ca48b9bc820 to your computer and use it in GitHub Desktop.
Save BraveTea/ad88ffa119637c8070ea4ca48b9bc820 to your computer and use it in GitHub Desktop.
What is the whole static variable about? This is code to figure that out and ask for help
public class HelloWorld {
private static final double PI = 3.14;
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("Hello World!");
System.out.println(PI);
for (int PI = 0; PI < 5; PI++)
{
System.out.println(PI);
}
System.out.println(PI);
int PI = 2;
System.out.println(PI);
}
}
/* OUTPUT
0
1
2
3
4
3.14
2
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment