Explore BrainMass

About java

From the program attached, perform each of the following experiments. Explain in a word document what happens when you do each operation and why this happens.

1. "Comment out" one of the method declarations for class Fraction.
2. "Comment out" the toString method in class Fraction
3. Remove the comment in front of the line: // Number stupid = new Number();
4. Remove the cast operation in the line: Number temp = (Number) nextS;


Solution Preview

Modified file attached

1. Fraction is not abstract and does not override <method> in java.lang.Number
This error comes in because once the method declaration in commented out, it is no longer executed as a code. The ...