Fractions Questions
From Huben's Wiki
(Created page with "Here are some questions you should be able to answer when we are done. * Why is this statement wrong? Fraction aFraction = Fraction(); * Before you created Fraction.toString(...") |
|||
Line 1: | Line 1: | ||
Here are some questions you should be able to answer when we are done. | Here are some questions you should be able to answer when we are done. | ||
− | * Why is this statement wrong? Fraction aFraction = Fraction(); | + | * Why is this statement wrong? Fraction aFraction = Fraction(1,4); |
* Before you created Fraction.toString(), System.out.println(aFraction); printed "Fraction:1ee7df24". | * Before you created Fraction.toString(), System.out.println(aFraction); printed "Fraction:1ee7df24". | ||
Line 8: | Line 8: | ||
** How could you write that PrintStream.println method using PrintStream.println(String)? One line. | ** How could you write that PrintStream.println method using PrintStream.println(String)? One line. | ||
− | * After you created Fraction.toString(), System.out.println(aFraction); printed using your toString. Why? | + | * After you created Fraction.toString(), System.out.println(aFraction); printed "1/4" using your toString. Why? |