Declare a variable
See Definition of a Variable
To declare a variable in Java use:
type nameOfVariable;
or
type nameOfVariable = expression;
Common Errors:
You can't create two variables with the same name in the same scope (like in the same method).
Examples:
boolean returnFlag;
boolean success = false;
int count = 0;
int numTimes;
double sum = 0;
double average;
Links to this Page
- Declarations last edited on 21 March 2005 at 3:46 pm by user-11210m8.dsl.mindspring.com
- Definition of a Variable last edited on 21 March 2005 at 3:59 pm by user-11210m8.dsl.mindspring.com