O'Reilly logo

Technical Java™: Developing Scientific and Engineering Applications by Grant Palmer

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

Chapter 8. Variables

In Chapter 7 we discussed how classes could define fields as members of the class. You may be more familiar with the term variable. A variable is a storage location. A variable always has a type associated with it. A variable of primitive type holds the value of a primitive type. A reference type variable holds either a null reference or a reference to an object of the same type as the variable. There are seven kinds of Java variables. Fields, depending on how they are declared, represent two of them. Fields that are declared as static are called class variables. Fields not declared as static are called instance variables. The other Java variable types are array components, method parameters, constructor parameters, exception ...

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