Hi Saheed,
One more question: I ran the code in Max's book(Interesting i must add), i howvever checked out the dvd_db and i found some files. I was wondering if that's how the db.db file comes with the assignment.
In the assignment you will get
a single data file, which contains all the records you work with.
In the assignment you will have to develop the code to read and write the records in this file - in Max's book each file is a serialized object.
As you read through the book you will find other differences as well ... In developing sample projects, there is always the dilemma of creating a project that meets many of the requirements set forth by the real
SCJD project, while not actually giving away the
test solution. This is actually quite a difficult task – it is very easy to develop a replica of the assignment you will receive from Sun, and discuss how to solve it’s problems. However tempting that might be for some people, we know that most SCJD candidates really want to go through the challenges of the real project themselves, and thus derive a greater sense of achievement when they complete it. Therefore the project in the book covers most of the same issues as the real assignment, while remaining different enough that you will not be able to copy and paste code into your assignment. While some parts are simpler than the real assignment, others are far more complex. Therefore anyone attempting to use the provided code as a base will need to really understand the code in order to determine which parts can be removed, not to mention which parts need to be added.
I ran and found out the "Magic cookie" of the each record was the same.
As Max's book uses serialization, he does not rely on magic cookies.
The JVM itself does use cookies. You can identify a
Java class by the first four bytes:
The first four bytes (CAFE BABE) are the 'magic cookie' that identifies a Java Class.
Similarly you can look at the magic cookie for a serialized class:
But that doesn't really tell us much. Of much more interest is the serial version ID:
Anyways guys HELP OUT.
Do you feel that you aren't getting answers to your questions? If so, perhaps you could rephrase the question. In any case, please
don't shout.
Regards, Andrew