Java   View all facts   Glossary   Help
syntactic unit > declaration > variable declaration
Next declaration: array declaration    Up: declaration    Previous declaration: parameter declaration   

variable declaration
subjectfact 
variable declarationcan be placed practically anywhere in Java source code although it is good practice to only declare variables at the beginning of blocks    source: Object Oriented Software Engineering by Lethbridge and Laganière, 2001-10-19 11:38:13.0
has example
int anInteger;    
source: Object Oriented Software Engineering by Lethbridge and Laganière, 2001-10-19 11:38:13.0
has example
Rectangle rect = new Rectangle(); 
added by: JK, source: Sun Java Tutorial, 2001-10-19 11:38:13.0
has purpose to declare a variable2001-10-19 11:38:13.0
has syntax
accessLevel static final transient volatile type variableName
added by: JK, source: Sun Java Tutorial, 2001-10-19 11:38:13.0
is a subtopic of Variables and Data Types2001-10-19 11:38:13.0
is a kind of declarationadded by: JK, 2001-10-19 11:38:13.0
must contain the type name and the variable nameadded by: JK, source: Sun Java Tutorial, 2001-10-19 11:38:13.0
declarationis part of definition2001-10-19 11:36:35.0
syntactic unithas syntax rule
bold = mandatory
italic = non-terminal
normal font = optional
2001-10-19 11:38:04.0

Kinds of variable declaration :