O'Reilly logo

Sun Certification Training Guide (310-025, 310-027): Java™ 2 Programmer and Developer Exams by Jamie Jaworski

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Declaring and Using Variables

Variable declarations are used to identify the type associated with a variable. They can also be used to initialize a variable to a particular value of that type. Variables can be declared as a primitive type or an object type. When a variable is declared as a primitive type, the variable's declaration identifies the type of primitive values that can be stored by the variable. When a variable is declared as an object type, the variable declaration identifies the type of object (that is, class) that can be referenced by the variable.

Java supports two different kinds of variables: field variables and local variables. Field variables are variables that are declared as members of a class. They are also referred to as ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required