Date: Tuesday, January 29, 2008
Name: _______________________________
Class section: TR 9:00 a.m.
1. For each of the following strings, write "yes" or "no" depending on whether the string is a legal names of a Java variable.; if your answer is "no", briefly explain why.
27explorers
explorers27
north Pole27
priceMaps$
south_pole27
2. Translate the following sequence of Java statements into English; show, step by step, what will happen after each of these statements.
int numCountries;
numCountries = 193;
numCountries = numCountries
+ 1;
3. What is the result of the following Java operations:
13 / 2
13.0 / 2.0
13 % 2
13.0 % 2.0
-13 % 2