Declaring Variables Before using any variable, give it a name and data type. This is known as declaring a variable. The syntax for declaring a variable is dataType indentifier; or dataType identifier1, identifier2,.......; Java objects stores states in fields. Java programming language defines the following kind of fields / variables. Local Variables Local variables are