003 - Variables Flashcards
The term “class variable” is another name for ___.
Static fields, which have a fixed value regardless of instantiation and use the keyword static
The term “instance variable” is another name for ___.
A non-static field, that belongs to an object
A local variable stores temporary state; it is declared inside a ___.
Method
A variable declared within the opening and closing parenthesis of a method signature is called a ____.
Parameter
What are the eight primitive data types supported by the Java programming language?
Byte Short Int Long Float Double Boolean Char
Character strings are represented by the class ___.
Java.lang.String
An ___ is a container object that holds a fixed number of values of a single type.
Array
Create a small program that defines some fields. Try creating some illegal field names and see what kind of error the compiler produces. Use the naming rules and conventions as a guide.
Practice
In the program you created in Exercise 1, try leaving the fields uninitialized and print out their values. Try the same with a local variable and see what kind of compiler errors you can produce. Becoming familiar with common compiler errors will make it easier to recognize bugs in your code.
Practice
the ______ modifier tells the compiler that there is exactly one copy of this variable in existence
static
What’s the special word to declare a variable as local
There is no word todo this
What is args in public static void main(String[] args).
The parameter