Rolf W. Rasmussen

Author
+ Follow
since Nov 04, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Rolf W. Rasmussen

To clarify further:
The code

produces a compile-time error, because the code tries to override a static method. This behavior is defined by section 8.4.6.1 of the Java Language Specification.
The code

will compile successfully.
Neither of the code fragments successfully overrides anything. The last code fragment illustrates Hiding by Class Methods as described by section 8.4.6.2 of the Java Language Specification.
Overriding and hiding are closely related, since they both prevent the method from the super class from being inherited to the subclass, but technically it is incorrect to mix these terms.
If you declare a static method in a subclass that has the same method signature as a method in a superclass, then you are hiding the superclass method from the subclass. You are not overriding it.
Overriding methods implies that you will have dynamic method lookup (facilitating polymorphic behavior), which is not the case for static method.
So to answer your question: Static methods can never be overridden.

Is the book tailor made for the exam or can I also use it for reference.


The book can definitely be used as a Java language reference, since it
has very thorough coverage of the core features of the language.
However, it is not suitable as a API reference, since it only covers
the APIs important for the exam.
While adding several hundred pages of API documentation would have
been an easy way of inflating the page count, we don't think that
would have been useful for the reader. The Java class library
API documentation is freely available from Sun, and O'Reilly
has some really great API reference books that would be hard to
compete with.

As it uses UML do i need any prior UML knowledge for this book.


The book does not assume that you know anything about the UML notation.
Basically, instead of inventing our own notation (which some authors do),
we chose to use a standardized notation for our figures.
As an added benefit, people how haven't been seen to UML diagrams before,
will actually learn some UML along the way.

Does your book rely on any particular platform.


No, the book does not rely on any particular platform. While writing
the book the authors regularly used:

  • MacOS
  • SunOS / Solaris
  • Debian GNU/Linux
  • Microsoft Windows


  • Java is a cross-platform language, and its sad to see when it is presented
    in a Windows only environment, as is the case with many books.
    One unfortunate exception is the Whizlabs exam engine that is
    included on the CD-ROM accompanying the book. Their exam engine will
    only run on Windows 98, Windows 2000 and Windows XP.
    However, the mock exam engine we as authors has included will
    run on all platforms with a modern Java VM.
    At the risk of being redundant, here are some additional comments:
    There are several things different between the first and second edition,
    the most obvious being that the first edition covers the 1.2 exam,
    while the new edition covers the 1.4 exam (CX-310-035).
    All changes in the scope of the exam has been dealt with by either
    weaving new material or removing material no longer relevant
    to the exam. In addition to the scope changes, a lot of work was
    spent updating the book to reflect the current state of the
    Java language in a natural way, rather than just tack on addendums
    covering the changes since 1.2. E.g. the addendum on assertions
    that we posted to help people take the 1.4 exam with the
    first edition has now been properly integrated into the book.
    We also had a chance to revisit parts of the book that we were
    unhappy with from the first edition, or portions that we know
    through reader feedback that people had difficulties with.
    An obviously, the new manuscript has gone through several
    rounds of technical review and proofreading that caught
    errors both in the new and original material.
    Here is a short excerpt from the new preface (available at http://www.ii.uib.no/~khalid/pgjc2e/JC2_Preface.pdf ):


    The exam for the Sun Certified Programmer for Java 2 (SCPJ2)
    Platform has changed considerably since the first edition of
    this book was published. The most noticeable change in the current
    version of the exam (SCPJ2 1.4) is the removal of GUI and I/O, and
    the shifting of emphasis toward the core features of the language.
    In our opinion, the new exam demands an even greater understanding
    and actual experience of the language, rather than mere recitation
    of facts. Proficiency in the language is the key to success.
    The I/O and GUI topics of the first edition have been eliminated,
    as they have no relevance for the SCPJ2 exam. These topics are
    more relevant for the Sun Certified Developer for Java 2 (SCDJ2)
    Platform exam and, therefore, relegated to a possible future
    volume on the Developer exam topics.
    Since the emphasis of the SCPJ2 exam is on the core features of
    Java, the second edition provides an even greater in-depth coverage
    of the relevant topics. The book covers not just the exam objectives,
    but also supplementary topics that aid in mastering
    the exam topics.
    The second edition is still a one-source guide for the SCPJ2 exam:
    it provides a mixture of theory and practice for the exam. Use the
    book to learn Java, pass the SCPJ2 exam, and afterwards, use it as
    a handy language guide. The book also has an appendix devoted to
    the SCPJ2 Upgrade exam. To facilitate preparation for the exams,
    the second edition comes with a CD containing additional resources,
    including several mock exams developed by Whizlabs Software.


    Regarding the second question: "Any plans to write a book on Java v 1.5?"
    When writing about Java, we always try to reflect the use of the
    latest version of the language and SDKs, whatever they may be.
    While we don't have any concrete plans of writing a general
    "Java v 1.5" book, we'll continue to track the SDK releases
    given out by Sun Microsystem and keep an eye out for changes
    that they may introduce to the SCPJ2 exam.
    Ahh, you're looking at shorthand description of the IEEE Floating Point
    Standard (IEEE 754) that the Java Language specification uses to
    describe the behavior of the float and double types.
    The formulas in the text you pasted got lost, making the text even harder
    to interpret than it already was.
    First off, let me assure you that you don't have to understand these
    formulas to pass the certification exam.
    Things relevant for the exam are:
  • The upper and lower bound of the types.
  • Knowing which operations will result in NaN, and +/- INF.
  • Knowing that loss of precision can occur.


  • For a bit more readable presentation of the IEEE Floating Point
    Standard (IEEE 754) representation, you can read:
    http://en.wikipedia.org/wiki/IEEE_Floating_Point_Standard
    http://www.d6.com/users/checker/pdfs/gdmfp.pdf
    Just keep in mind that the bit patterns presented does not necessarily
    directly correspond to the in-memory patterns used by the Java VM.
    The only thing that is guaranteed is that the externally visible effect
    of the mathematical operations are identical to the ones specified
    by IEEE 754.