Java 2 All-in-One Certification Exam Guide

( 5 )

Overview

All-in-One is all you need! This authoritative reference offers complete coverage of all material on the Java 2 certification exams. You*ll find exam objectives at the beginning of each chapter,helpful exam tips,end-of-chapter practice questions,and photographs and illustrations. The bonus CD-ROM contains practice tests,hundreds of questions,and video clips. This comprehensive guide not only helps you pass this challenging certification ...
See more details below
Available through our Marketplace sellers.
Other sellers (Hardcover)
  • All (28) from $1.99   
  • New (4) from $26.00   
  • Used (24) from $1.99   
Close
Sort by
Page 1 of 1
Showing All
Note: Marketplace items are not eligible for any BN.com coupons and promotions
$26.00
Seller since 2008

Feedback rating:

(167)

Condition:

New — never opened or used in original packaging.

Like New — packaging may have been opened. A "Like New" item is suitable to give as a gift.

Very Good — may have minor signs of wear on packaging but item works perfectly and has no damage.

Good — item is in good condition but packaging may have signs of shelf wear/aging or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Acceptable — item is in working order but may show signs of wear such as scratches or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Used — An item that has been opened and may show signs of wear. All specific defects should be noted in the Comments section associated with each item.

Refurbished — A used item that has been renewed or updated and verified to be in proper working condition. Not necessarily completed by the original manufacturer.

New
0072191694 BRAND NEW NEVER USED IN STOCK 125,000+ HAPPY CUSTOMERS SHIP EVERY DAY WITH FREE TRACKING NUMBER

Ships from: fallbrook, CA

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
$27.15
Seller since 2005

Feedback rating:

(14)

Condition: New
New Brand New-no DJ issued-may have slight shelf wear to edges.

Ships from: Irving, TX

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
$34.50
Seller since 2014

Feedback rating:

(226)

Condition: New
Brand New Item.

Ships from: Chatham, NJ

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
$45.00
Seller since 2014

Feedback rating:

(113)

Condition: New
Brand new.

Ships from: acton, MA

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
Page 1 of 1
Showing All
Close
Sort by
Sending request ...

Overview

All-in-One is all you need! This authoritative reference offers complete coverage of all material on the Java 2 certification exams. You*ll find exam objectives at the beginning of each chapter,helpful exam tips,end-of-chapter practice questions,and photographs and illustrations. The bonus CD-ROM contains practice tests,hundreds of questions,and video clips. This comprehensive guide not only helps you pass this challenging certification exam,but will also serve as an invaluable on-the-job reference.

Prepare to pass both the programmer's and developer's certification exams Now you can prepare for the two widely taken Java 2 exams—the programmer's and developer's exams—using this single comprehensive volume. This reference will map out all objectives for both exams and provide you with Java programming essentials. Each chapter contains numerous practice questions,illustrations,and test-taking tips,making it a premier study tool. And,it's packed with helpful sidebars offering in-depth technical discussions of concepts and techniques you've just read about.

Get complete details on exam topics,including how to:

  • Apply programming fundamentals
  • Design application interfaces
  • Utilize graphics,components,and layout managers
  • Use objects,constructors,and classes
  • Find out about inheritance,multithreading,and string handling
  • Access and manage databases
  • Identify when an object is eligible for garbage collection
  • Work with control statements,data types,and variables
Read More Show Less

Product Details

  • ISBN-13: 9780072191691
  • Publisher: McGraw-Hill Companies, The
  • Publication date: 9/25/2001
  • Edition description: Third
  • Edition number: 3
  • Pages: 697
  • Product dimensions: 7.60 (w) x 9.20 (h) x 2.28 (d)

Meet the Author

William Stanek (Olympia, WA) produces practical and professional advice has helped millions of Web publishers, programmers, and developers all over the world. William is also a frequent contributor to PC Magazine.
Read More Show Less

Read an Excerpt

Chapter 5: Memory and Garbage Collection

Objectives for This Chapter
  • Identify when an object referred to by a local variable becomes eligible to be garbage collected (in the absence of compiler optimization).
  • Describe how finalization works and the behavior Java guarantees regarding finalization.
  • Distinguish between modifying variables containing primitive data types and object references, and modifying the objects themselves.
  • Identify the results of Java's pass-by-value approach when passing parameters to methods.
Java manages your program's memory. This eliminates all manner of bugs that creep into programs built with languages where you must access and manage memory directly. Java's role in managing memory eliminates bugs involved with the following:
  • Freeing memory too soon (resulting in a dangling pointer)
  • Not freeing memory soon enough or at all (resulting in a memory leak)
  • Accessing memory beyond the bounds of the allocated memory (resulting in using uninitialized values)
When you want to define a new data type, you define a new class. You can allocate an instance of a class by using the new keyword, which returns an object reference. This object reference is essentially a pointer to the object in memory—except in Java you cannot manipulate this object reference like a number. You cannot perform pointer arithmetic.

Objects are allocated from a garbage-collected heap. You cannot directly alter the memory in this heap. You can only get at the objects in this heap by using object refer-ences. Since Java manages the heap, and since you cannot manipulate object references, you must trust the Java Virtual Machine (JVM) to do what's right: free memory when it should, allocate the correct amount of memory when needed, and so on. But don't worry; the JVM is very good at its job—much better than any of us error-prone humans.

Garbage Collection

For the exam, you'll need to be able to identify when an object referred to by a local vari-able becomes eligible to be garbage collected (in the absence of compiler optimization). Since Java manages the garbage-collected heap, which is where all your objects live, you've got to trust Java to manage the memory for you. This includes believing that the JVM really will free memory that you no longer need when it runs low.

When Does an Object Become
Eligible for Garbage Collection?

An object becomes a candidate for garbage collection when your program can no longer reference it. Here is an example. Let's say you allocate an object and only assign it to a method variable. When that method returns, you have no way to ever refer to that method variable again. Therefore, the object is lost forever. That means that when the method returns, the object is a candidate for garbage collection.

As another example, you might create an object, assign this object to an object reference, and then set this object reference to null. As soon as you lose the reference to the object, that object becomes a candidate for garbage collection.

Just because your program might lose a reference to an object does not mean that the JVM will reclaim that object's memory right away, or even at all. The JVM will only perform garbage collection if it needs more memory to continue executing. For almost all simple programs, including the ones you've seen so far, the JVM doesn't even come close to running out of memory.


CAUTION: The reason the garbage collector does not reclaim memory as soon as it is available is that garbage collection takes time. If the garbage collector were continuously expunging allocated memory that you could no longer access, it would seriously slow your program's execution. It is not guaranteed that the garbage collector will reclaim objects in a certain order. This allows the garbage collector to run as efficiently as possible.

Even though a new keyword exists, notice that you do not explicitly indicate how much memory to set aside. The JVM determines this for itself. The JVM determines the memory your object requires based on

  • The amount of memory needed to maintain instance variables for the object
  • A standard overhead required by all objects
What's more, even though Java supplies the keyword new, no corresponding delete is available, nor any other way to directly free memory. The way you indicate you are through with an object is to set its object reference to null or to some other object. Or, as mentioned, when a method returns, its method variables will no longer be valid, so the garbage collector also knows any objects referenced by method variables are candidates for garbage collection.

Invoking the Garbage Collector

Even though you cannot free objects explicitly, you can directly invoke the garbage collector. This will make the garbage collector run, which will reclaim candidates for garbage collection.

They way you run the garbage collector is to perform two steps:

  1. Get an object that represents the current runtime.
  2. Invoke that object's gc() method.
Here is a snippet that does this:
Runtime rt = Runtime.getRuntime();
rt.gc();

Exercise 5-2 asks you to work through an example of this.

Finalization

For the exam, you'll need to know when finalization takes place. In most situations, you'll never know when garbage collection has occurred. Java runs the garbage-collecting process as a low-priority background thread. The garbage collector will run whenever memory gets low.

However, you can get into the act of garbage collection. If you want to perform some task when your object is about to go away, you can override a method called finalize().

Java will invoke the finalize() method exactly once for every object in your program. finalize() is declared as protected, does not return a value, and throws a Throwable object.

Java invokes the finalize() method just before an object is about to be garbage collected. You might take advantage of this notification to clean up any resources that have been allocated outside this object. A classic example is a file that an object has opened that might still be open. The object can check to see if the file has been closed in finalize() and, if not, it will close the file....

Read More Show Less

Table of Contents

Introduction
Pt. I Studying for the Programmer's Exam 1
Ch. 1 Programmer Exam Roadmap 3
Ch. 2 Java Programming Fundamentals 17
Ch. 3 Java Keywords 31
Ch. 4 Java Building Blocks 43
Ch. 5 Memory and Garbage Collection 57
Ch. 6 Data Types and Values 73
Ch. 7 Operators 91
Ch. 8 Control Flow 117
Ch. 9 Methods 137
Ch. 10 Constructors 153
Ch. 11 Objects and Classes 167
Ch. 12 Packages, Inheritance, and Interfaces 207
Ch. 13 Passing Arguments to Programs 233
Ch. 14 Exceptions 249
Ch. 15 Multithreading 271
Ch. 16 Essential java.lang and java.util 301
Ch. 17 java.io 325
Ch. 18 java.awt: Graphics and Components 357
Ch. 19 java.awt: Layout 393
Ch. 20 java.awt: Event Handling 409
Ch. 21 Sun Certified Programmer Practice Exam 1 429
Ch. 22 Sun Certified Programmer Practice Exam 2 459
Ch. 23 Sun Certified Programmer Practice Exam 3 483
Pt. II Studying for the Developer's Exam 511
Ch. 24 Developer Exam Roadmap 513
Ch. 25 Developing with Java 523
Ch. 26 Accessing and Managing Databases 551
Ch. 27 Network Programming and Communication 577
Ch. 28 Designing Application Interfaces 623
Ch. 29 Sun Certified Developer Practice Programming Assignment 643
Ch. 30 Sun Certified Developer Practice Essay Exam 675
Pt. III Appendices 681
App. A: What's on the CD-ROM 683
App. B The JDK 685
Index 689
Read More Show Less

Customer Reviews

Average Rating 3.5
( 5 )
Rating Distribution

5 Star

(3)

4 Star

(0)

3 Star

(0)

2 Star

(1)

1 Star

(1)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing all of 5 Customer Reviews
  • Anonymous

    Posted June 21, 2003

    Don't bother buying

    Don't bother reading the book, there are errors all over the place (begining with Ch 1). Guess if you don't have any knowledge of Java, you won't notice the errors! I wish I had read the book immediately after buying it. I read it couple of months after buying and so could not even return it for a refund.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted January 11, 2003

    Dont bother buying Certification books

    After reading several reviews, i was disappointed when i finished reading this book .... The book contained syntax errors and codes that doesn't even compile. I wondered if the author ever compiled his codes .... I just finished the java 1.4 certification exam and passed with the help of "THINKING IN JAVA" by Bruce Eckel. ... I advise you to find the topic for the certification exam and then go purchase Thinking in java and review each topic. The book shoud provide you with explicit information to help you pass the exam ... *******Dont bother buying ANY certification exam books ***** You might as well spend the money on THINKING IN JAVA, which provide you detailed information rather generalize shorten reviews on each topic as given by certification books ... A few days before the exam you should sit for an hour or two at Barnes and Noble and review the sample exams given by certification books, but be advised that the author's mock exams may contain syntax and even semantics errors.... Well hope this helps... and if your still worrying about certification exams.... just know that i COUNTER STRIKE the week before the exam and studied at most 3 hours and still passed the exam.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted May 3, 2002

    Great for Java certification

    I studied Java 2 from other books and bought this book so I could prepare for certification. This book is excellent for that purpose. The first 500 pages are about the programmer's exam. Each chapter is very comprehensive and in the end you can take practice tests about the whole area. This first part is what I use frequently to test my skills and knowledge.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted February 16, 2002

    THE BEST!!!

    This is the best Java book I found! I read several others but this was the one that answered my questions and was usable. I highly recommend this book to anyone looking to certify. This book also makes a great reference -- I used it everyday!

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted November 26, 2001

    EXCELLENT!!

    Java 2 AllinOne Cert guide is well-organized and very accurate! I've used it to help me learn more about Java programming and I refer to it often... I'm also using the book to study for certification. I originnaly picked this because it had the most thorough reviews. It has lots more exam review sections and questions than any other Java certification book. It is also the most complete in content. I HIGHLY RECOMMEND to anyone that is working with Java and/or studying with certification.

    Was this review helpful? Yes  No   Report this review
Sort by: Showing all of 5 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)