Uh-oh, it looks like your Internet Explorer is out of date.

For a better shopping experience, please upgrade now.

Sun Certified Programmer for Java 2 Study Guide (Exam 310-025)

Sun Certified Programmer for Java 2 Study Guide (Exam 310-025)

2.5 2
by The Staff of Syngress Media Inc. (Editor), Brian Bagnall (Other), Inc Syngress Media (Other)
The only classroom-based training and self-assessment system! Osborne's Sun Certified for Java 2 Study Guide provides 100% complete coverage of all official exam objectives for this challenging exam. Based on 200,000+ hours of IT training experience,the book contains hundreds of practice exam questions and hands-on exercises. The CD-ROM features full CertTrainer CBT


The only classroom-based training and self-assessment system! Osborne's Sun Certified for Java 2 Study Guide provides 100% complete coverage of all official exam objectives for this challenging exam. Based on 200,000+ hours of IT training experience,the book contains hundreds of practice exam questions and hands-on exercises. The CD-ROM features full CertTrainer CBT software with interactive tutorials and lab simulations,plus the new ExamSim adaptive test engine.

The Only Certification Study System Based on 200,000+ Hours of IT Training Experience

  • 100% Complete Coverage—All official test objectives for exam 310-025 are covered in detail

  • Hands-on Exercises—Step-by-step instruction modeled after classroom labs

  • Exam Watch—Warnings based on thorough post-exam research identifying the most troublesome exam topics and how to answer them correctly

  • Three Types of Practice Questions—Knowledge,scenario,and lab-based questions,all with in-depth answers

  • From the Classroom—Discussions of important issues direct from the classrooms of Global Knowledge's award-winning instructors

Full coverage of the topics you need to review,including how to:

  • Write code that explicitly makes objects eligible for collection

  • Write code using loops

  • Write code using if and switch statements

  • Catch an exception using try and catch

  • Write and throw your own exceptions

  • Design and implement tightly encapsulated classes

  • Transition between thread states

  • Communicate with objects by waiting and notifying

  • Use the StringBuffer class

CD-ROM features full CertTrainer CBTsoftware and the new ExamSim test engine—more than 275 questions on CD


  • e-Training—Self-paced review of key Java 2 topics,including exam tips

  • In-depth Links—Need more explanation? Topically relevant links provide detailed instruction

  • Skill Assessment—Test your knowledge with more than 250 challenging practice exam questions

  • Score Reports—Indicate subject areas requiring further study


  • Complete Practice Exam—A realistic Java 2 exam with questions found only on the CD-ROM

  • Review Mode—Analyze what you got wrong and why

  • Detailed Answers—Explain why the correct options are right and why the incorrect options are wrong

  • Score Report—Provides an overall assessment of your performance

E-book—Electronic,searchable version of the Study Guide

Product Details

McGraw-Hill Companies, The
Publication date:
Certification Press Series
Product dimensions:
7.40(w) x 9.52(h) x 2.22(d)

Read an Excerpt

Chapter 1: Language Fundamentals

This chapter will familiarize you with the Java fundamentals that you need to know in order to pass the Java 2.0 Programmer exam. Because you are planning on becoming Sun certified, it is probably safe to assume that you know the basics of Java, so this chapter will focus on the details you might not be familiar with, but which are essential for passing the exam.

Certification Objective 1.01

Source Files

A source file is a plain text file containing your Java code. The Java compiler javac processes the source file to produce a byte code file, which ends with the suffix class.

Exam Watch
The exam is concerned with how the Java compiler deals with a source file. For this reason, it is a good idea to prepare for the exam using only the Java Development Kit (JDK) 1.2 or 1.3 supplied by Sun, a text editor, and a command prompt. This may be a little awkward at first for people used to working in an integrated development environment such as IBM's Visual Age forJava. You are roughing it a bit by using only the command line, but perhaps it will give you the same back-to-basics thrill as starting a fire with two sticks.

A Java source file must meet strict requirements; otherwise, the Java compiler will generate errors. A plain text file can be compiled using the JDK in the following manner, and will produce no screen output from the compiler if successful:

c:\Java Projects>javac Calculate.java
c:\Java Projects>

Now, if you look in the Java Projects directory, you will see a file named Calculate.class. The source file must be saved with the suffix java. If you try to compile a source file that does not have the java suffix, the compiler produces an error:

c:\Java Projects>javac Calculate.jav
Calculate.jav is an invalid option or argument.

Identifiers are names that we assign to classes, methods, and variables. Java is a case-sensitive language, which means identifiers must have consistent capitalization throughout. Identifiers can have letters and numbers, but a number may not begin the identifier name. Most symbols are not allowed, but the $ and _ (underscore) symbols are allowed because they provide support for preexisting names on earlier systems. Examine the following examples:

int 99year; // invalid
int year99; // valid
int hello#; // invalid
int $hello$; // valid
int MAX-VALUE; // valid

File names are also case sensitive. The file itself can contain as many spaces, tabs, and carriage returns as you wish, but they must not break up words within the file. For example, the following file will compile just fine:

		MyClass { int 

At the very least, a source file must contain...nothing! That's right, the compiler will produce no errors when compiling a blank file. The minimum viable source file, which will produce a class, looks like this:

class MyClass {}

A source file may only have one public class or interface and an unlimited number of default classes or interfaces defined within it, and the filename must be the same as the public class name. For example, the following file is saved as MyClass.java:

// Will not work
public class YourClass {}

When we attempt to compile, we get the following error:

C:\Java Projects>javac MyClass.java 
MyClass.java:1: Public class YourClass must be defined in 
	a file called "YourClass.java"

It is not imperative for the filename to match the name of a class (or interface) in the source file. For example, a file could be called ChessPieces.java and contain classes such as Rook, Knight, and King. If there is a public class/interface in the source file, however, then the name of the source file must be the same as the name; of the public class. The following file has the filename BobsClass.java, and it will compile fine because there are no public classes:

// This works
class YourClass {}
class MyClass {}
class JensClass {}

Exercise 1-1 demonstrates how to create a basic source file and compile it. Create a source file containing one public class and two default classes. The classes can be empty, with just curly braces after the class declaration. Save the file with a legal file name and compile it with the standard Sun 2.0 Java compiler....

Customer Reviews

Average Review:

Post to your social network


Most Helpful Customer Reviews

See all customer reviews

Sun Certified Programmer for Java 2 Study Guide (Exam 310-025) 2.5 out of 5 based on 0 ratings. 2 reviews.
Guest More than 1 year ago
Do not buy this book, unless you are a person interested in proofreading. This book is FULL and I mean FULL of errors. You buy the book looking to get certified only to find out that half the time you have correct what the editors goofed up on. I think they really rushed in printing this book. I went to their website to find corrections to the book, only found three, while I found four more corrections and submitted those corrections to the editors. I want to spend time studying, not proofreading. Last but not least, I took the practice exam that is included on the CD. When it was time to review answers I got wrong, I got explanations that don¿t even match the question! It could be a question about AWT Events and their explanation tells you why your String object threw an exception. Confused? That is what you are going to be if you buy this book! I really wish I can get my money back for this book... its $50 garbage.
Guest More than 1 year ago
The book provided good overall coverage of the material. It and Sun's free practice questions (and my day-to-day use of Java on the job) are all I used to pass the test. Almost every chapter has an error in it, and about a third of them have errors in the review questions, which is part of the reason this package is flawed. the main reason is that the 'ExamSim' is truly awful: at least 4 of the questions on the test (and probably a lot more) are wrong... Seriously flawed, as in their explanation does not match the question, or their explanation's answers were not the answer choices you had. Still, I studied until I got at least 65% at the end of each chapter and I passed the certification exam the first time, so it must not be too bad.