星期六, 12月 08, 2007

Quiz on Chap. 4

1. Explain API and ADT.
2. How are the object variables managed by Java compilers? Are they managed in the same way as variables of primitive types?
3. In the following statement,

Date myDate= new Date();

What is the use of "new"?

4. Design a method that can compute the vector inner product. You must define Vector class in the first place. Write a demo program to verify your program works.

5. Define a class called Counter whose objects count things. An object of this class records a count that is a nonnegative integer. Include methods to set the counter to 0, to increase the count by 1, and to decrease the count by 1. Include an accessor method that returns the current count value and a method that outputs the count to the screen. Write a program to test

沒有留言: