1. A variable is a named memory location for which
a. both the name and location are decided by the computer
b. both the name and location are decided by the programmer.
c. the name is given by the computer, and the programmer decides the location.
d. The programmer gives the name, the operating system allocates memory location
e. None of the above
2. Logical errors are programming mistakes that
a. are found by the compiler
b. violate the Java programming traditions
c. cause the program to produce wrong output
d. are different from syntax errors and runtime errors
e. All the above
3. The Java String class has methods that
a. find syntax errors
b. process Boolean expressions
c. evaluate arithmetic operations
d. Java String class use variables
e. manipulate character sequences
4. The expression ‘public’ in a Java program
a. is a class name
b. is a variable name
c. is a reserved word
d. is used for documentation
e. refers to a package in the Java library
5. Variables of primitive types
a. can hold numeric values exclusively
b. determine the values they may refer to.
c. are also called reference variables in Java
d. hold the address of another memory location
e. are reserved memory locations to store the assigned values
6. An if-else logic
a. created a boolean expression
b. is controlled by a numeric expression
c. is controlled by a block of statements to be executed
d. determines the order of execution of two blocks of statements.
e. selects exactly one of two blocks of statements for execution
7. An else clause
a. have a pair of parentheses
b. must have its own boolean control
c. is always coupled to one if clause
d. must always have a pair of braces{ }
e. none of above