Quiz 2
Version 1

 

 

1. Under what conditions can you skip lab? (Hint: did you read the syllabus?)

2. What's wrong with using the word synchronized as the name of a program (or as the name of an object inside a program)?

3. What is the difference beween print and println?

4. Every application program has to contain a certain special method, which is invoked automatically when the application is run. What is it called?

5. A double quote is used to mark the start and end of a string (e.g. "aardvark toenails"). So how do you write a string that contains a double quote (e.g. "aardvarks "have" toenails")?

6. What does the arithmetic operator % do? For example, what is 17%5?

7. What happens if you add a number to a string, e.g. 47 + " warts"?

8. What does the expression 1/5 + 1.0/5 evaluate to?

Last modified August 28 for Fall 99 cs5 by fleck@cs.hmc.edu


This page copyright ©1998 by Joshua S. Hodas. It was built with Frontier on a Macintosh . Last rebuilt on Sun, Sep 6, 1998 at 1:29:55 PM.
http://www.cs.hmc.edu/~hodas/courses/cs5/week_02/quiz.html