.. (לתיקייה המכילה) | ||
Do we have to use MyClass ? | |
It may be possible that you find a way to implement this assignment without changing the behavior of the 'Class' class. If this is the case in your assignment then just submit a 'MyClass' that subclasses 'Class' and has a single method: 'new' which has this body: '^ super new' |
Do we have to use a global variable ? | |
No |
Do all instances created using "Auto new" or "a dup" has to be of the same class? | |
No |
You said that two objects created using "Auto new" can be instances of two distinct classes. But in the example you published (in the assignment document) the error message shows that the class is Auto (for example: | |
All the example is saying is that I gave all dynamically created classes the same name 'Auto'. |
If we add fields or methods to a class, will they be recognized by pre-existing instances of this class? | |
Methods ? Yes. Fields are more complicated because you have to expand the size of each existing object to accomodate the new fields. That's why in this assignment you don't have to add new fields, just to rename them. |
The assingment mentions 5 fields that instances of Auto must have. If I need additional fields/methods in Auto (in order to implement the required functionality), besides those defined in the assignment, may I add them ? | |
Yes |
Suppose I have a class C that has a field (called d) holding an instance of a Dictionary. When I deepCopy an instance of this class, elements that I add to the dictionary at the first object are | |
When a dictionary is copied only a shallow copy of the dictionary is created. Thus, the hash-table used by a dictionary is shared by all duplicated dictionaries. You can look at the implementation of the deepCopy, copy methods to see that. |
After executing this piece of code: | |
I don't care about the return value of 'Auto variables' |