星期一, 12月 25, 2006
星期一, 12月 18, 2006
public static final double PI=3.14159;
public static double area(double radius)
public static double volume(double radius)
(2nd ed.) Do Project 7 of Chap 5. Define a Complex class and write a program to compute (2+3i)+(4+5i) in Java.
Implement a static method and a nonstatic method using overloading. The results of these two methods should be the same.
星期二, 12月 12, 2006
星期一, 12月 11, 2006
2 fractions should be equal to a fraction.
Use 1/2+1/3 as the test.
Fraction f1, f2;
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
星期五, 12月 08, 2006
星期一, 12月 04, 2006
Display 4.12 to call 4.11 (1st ed.).
After you finish the above, try the following
Date birthday = new Date("Jan",1,2000);