next up previous
Next: Modifers and functions Up: Assignment 10: Homemade Objects Previous: Rational numbers

Another constructor

1.
Write a second constructor for your class that takes two arguments and that uses them to initalize the instance variables.

2.
Add lines to main that test both constructors. You will probably want to add a print statement to the constructors so that you can tell exactly when each constructor gets invoked.



Allen B. Downey
1999-04-14