Java SE 11: Variables & Operators Flashcards
Variables can be initialized with.
A. Only A value
B. A value or without.
C. Without a value
B. A value or without.
All variables must have a variable _____
Type
You can set the value of a variable without having to declare the type a second time.
True or False
True
String zip;
zip = “83705”;
Variables have default value of __________
uninitialized
When declaring a string variable the string type must be declared with __________ letter
Uppercase
What are the naming guidelines for variables.
Begin each variable with a ______________ letter. Subsequent words should be _______________.
What are the naming guidelines for variables.
Begin each variable with a lowercase letter. Subsequent words should be capitalized.
Ex. myVariable
Names are not case-sensitive.
True or False
False
Name are case-sensitive
Names cannot include a white space
True or False
True
Names should be mnemonic and indicate to the casual observer the intent of the variable.
True or False
True
The Undserscore Character _ is a Legal within a vairable name
True or False
False
As of Java SE 9 the underscore character (“_”) is not a legal character and won’t compile in Java SE9 or later
What type of variable is followed by name of variable set to a string in quotes
String
String name = “Steve”;
What variable type has positive or negative real values containing decibel
double
double price = 9.99
Which variable type holds true or false values?
boolean
boolean outOfStock = false;
What is the default value of a boolean value?
false
String address = “123 Oak St”
Is this variable:
A. Declared
B. Initialized
C. Declared and Initialized
C. Declared and initialized