Java: 

Static Variables


Static Variables:
    Static variables are variables that have the same value for the whole class, not just an instance.
Below you can see the on line 2 how the static variable pi is accessed.

For Example...

1 public class Circle {
2 public static float pi = 3.14159265;
3
4 public float area(float r) {
5 return pi * r * r;
6 }
7 }

Java Tutorials

Last Updated: May 25, 2010

Valid CSS!

** PLEASE DESCRIBE THIS IMAGE **