Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Ganesh_JavaSE7_Programming_1z0-804_study_guide.pdf
Скачиваний:
88
Добавлен:
02.02.2015
Размер:
5.88 Mб
Скачать

For your convenience Apress has placed some of the front matter material after the index. Please use the Bookmarks and Contents at a Glance links to access them.

Contents at a Glance

About the Authors xvii About the Technical Reviewer xix Acknowledgments xxi Introduction xxiii

Chapter 1: The OCPJP 7 Exam: FAQ 1 Chapter 2: Pretest 11 Chapter 3: Java Class Design 45 Chapter 4: Advanced Class Design 87 Chapter 5: Object-Oriented Design Principles 113 Chapter 6: Generics and Collections 147 Chapter 7: String Processing 205 Chapter 8: Java I/O Fundamentals 225 Chapter 9: Java File I/O (NIO.2) 251 Chapter 10: Building Database Applications with JDBC 281 Chapter 11: Exceptions and Assertions 317 Chapter 12: Localization 361 Chapter 13: Threads 393 Chapter 14: Concurrency 435 Chapter 15: OCPJP 7 Quick Refresher 485

v

Contents at a Glance

Appendix A: Exam Topics 507 Appendix B: Mock Test – 1 513 Appendix C: Mock Test – 2 569

Index 619

vi

Introduction

This book is a comprehensive guide to preparing for the OCPJP 7 exam. This book covers the exam objectives of both OCPJP exams, Java SE 7 Programmer II (1Z0-804 exam) and Upgrade to Java SE 7 Programmer (1Z0-805 exam). The main objective of this book is to prepare the reader to take the OCPJP 7 exam and pass it with ease.

The book covers all of the exam topics for Java SE 7 Programmer II (1Z0-804 exam). The chapters and sections in this book map one-to-one to the exam objectives and subtopics. This one-to-one mapping between chapters and the exam objectives ensures that we cover only the topics to the required breadth and depth—no more, no less. If you’re taking Upgrade to Java SE 7 Programmer (1Z0-805 exam), see Appendix A for the key to how the exam topics map to the chapters of this book.

A reader will find lots and lots of sample questions in the form of a pretest, numerous sample questions within each chapter, and two full-length mock tests. These sample questions not only help the reader prepare for taking the exam but also set realistic expectations for what the reader will find on the exam.

There are many features in this book designed to present the content in a smooth, example-driven flow to improve your reading and study experience. For instance, the chapters provide numerous programming and real-world examples to help you internalize each of the presented concepts. Additionally, in each chapter we use visual cues (such as caution signs and exam tips) to direct your attention to important and interesting aspects of the concepts that are of particular relevance to the OCPJP 7 exam.

Prerequisites

Since the OCAJP 7 (a.k.a. Java SE 7 Programmer I/1Z0-803) exam is a prerequisite for the more comprehensive OCPJP 7 exam (1Z0-804), we assume that the reader is already familiar with the fundamentals of the language. We focus only on the OCPJP 7 exam objectives, on the presumption that the reader has a working knowledge in Java.

Target Audience

This book is for you if any of the following is true:

If you are a student or a Java programmer aspiring to crack the OCPJP 7 exam.

If you have already passed any of the older versions of the OCPJP 7 exam (such as the SCJP 5 exam). This book will prepare you for the Upgrade to OCPJP 7 exam (1Z0-805).

If you’re a trainer for OCPJP 7 exam. You can use this book as training material for OCPJP 7 exam preparation.

If you just want to refresh your knowledge of Java programming or gain a better understanding of various Java APIs.

Please note, however, that this book is neither a tutorial for learning Java nor a comprehensive reference book for Java.

xxiii

Introduction

Roadmap for Reading This Book

To get the most out of reading this book, we recommend you follow these steps:

Step 0: Make sure you have JDK 7 installed on your machine and you’re able to compile and run Java programs. Step 1: First read the FAQ in Chapter 1 and get familiar with the exam (you may want to skip irrelevant questions

or questions for which you already know the answers).

Step 2: Check the exam topics (Appendix A) and mark the topics you’re not familiar with or comfortable with. Read the chapters or sections corresponding to the topics you’ve marked for preparation.

Step 3: Take the pretest in Chapter 2. If you’ve answered all the questions correctly for an exam chapter, you may want to skip reading the corresponding chapter. For those exam topics in which you did not scored well, mark those chapters and read them first. Try out as many sample programs as possible while you read the chapters.

Step 4: Once you feel you are ready to take the exam, take the first mock test (Appendix B). If you don’t pass it, go back to the chapters in which you are weak, read them, and try out more code relating to those topics. Once you’re confident, attempt the second mock test (Appendix C). If you’ve prepared well, you should be able to pass it.

Step 5: Register for the exam and take the exam based on your performance in the mock tests. The day before taking the exam, read Chapter 15, “OCPJP 7 Quick Refresher.”

On Coding Examples in This Book

All the programs in this book are self-contained programs (with necessary import statements). You can download the source code of the programs from www.apress.com/9781430247647.

We’ve tested the coding examples in this book in two compilers, Oracle’s Java compiler JDK 7 (javac) and the Eclipse Compiler for Java (ecj). For the error messages, we’ve provided javac’s error messages. It is important that you use a Java compiler and a JVM that supports Java 7.

Java is a platform-independent language, but there are certain features that are better explained with a specific platform. Since Windows is the most widely used OS today, some of the programming examples (specifically some of the programs in the NIO.2 chapter) are written with the Windows OS in mind. You may require minor modifications to the programs to get them working under other OSs (Linux, MAC OS, etc).

Contact Us

In case of any queries, suggestions or corrections, please feel free to contact us at sgganesh@gmail.com or tusharsharma@ieee.org.

xxiv

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]