![]() |
.. (לתיקייה המכילה) | |
Can we add classes which are not mentioned in the specification to our implementation ? | |
Yes. But, as mentioned in the homework document, these classes should not affect the protocol of the Counter class |
(a) Do I need to document my code? | |
(a) No (b) No |
Why don't you want us to document our code? | |
I want your code to be simple and undetstandable. If you rely on the documentation to help me understand the code, then either the code is too complicated, or the names of the fields/classes/methods do not properly describe their role. |
Is it possible for a programmer to define new instances of the Formatter class? | |
No. He is only allowed to use the predefined instances FORMATTER_A ... FORMATTER_O |
Regarding formatters M and N: What happens if they are invoked on a root counter (a counter which has no parent)? | |
The specs do not talk cover this point. The correct output (for a root counter, c) is: Integer.toString(c.get()) |
In the non default constructor documentation it is written "The | |
Well, it depends on how you read it. Anyway, what I meant is: child.formatter = parent.formatter; |
In FORMATTER_I, is there a mistake in the example code? The example output is | |
Yes, you are right. |