Subject: Re: [very good] hw3 questions
From: Paul Freeman (email@example.com)
Date: Mon Oct 14 2002 - 17:44:15 EDT
Hi Class -
You all should read the answers to these questions.
> 1: How can those of us working from home obtain the rt.jar file
> necessary to compile part 1?
the dj runtime library can be found here:
> 2: In part 2, the unknown3 block of code appears to exist
> outside of any classes or aspects. Should this unknown block contain
> a new class or aspect containing our code?
no... I was able to solve this by inserting Unknown 3 at the bottom of
the Checker aspect. Just remove the "}" above unknown 3 and place it
below your solution.
> 3: In part 2, my solution correctly allows calls to arguments,
> but if I pass a string as an argument and create a new string inside
> the method with the same text, calls involving that string are
> allowed as well. Is this acceptable?
You are correct that it should not be. However, ignore this behavior
for now. This is due to the storage implimentation in the supplier
class. The supplier class uses a HashMap to store the arguments and
Java's implimentation of HashMap must use the value of the object being
stored to create the hash index. Since both strings have the same
value, they hash to the same location in the hashmap, and therefore a
variable with a different name that has the same value returns true from
the method "contains". This also occurs for two Integer objects, etc.
If you know how to fix it easily, go ahead. But don't waste time on it.
Excellent catch by the way!
> 4: Since part 3 requires a correct solution to hw2, will the
> solution to hw2 be posted before hw3 is due?
I wasn't planning on releasing the answers to hw 2 until thursday. I
will instead send out individual emails to those who turned HW2 with the
missing line and where to place it. If you didn't turn in HW2 and are
planning on turning in both HW2 and HW3 on thursday. Send me HW2 via
email and I will send out the correct line to you. I'm grading HW2 now
so I'll send out the correct line first thing tomorrow morning. You
should be able to put together the application without the missing line.
You can just add this tomorrow or whenever you have a chance.
This archive was generated by hypermail 2b28 : Mon Oct 14 2002 - 17:47:14 EDT