[JAVA][Fast Track Certified Java Programmer (SCJP) 5].pdf

(591 KB) Pobierz
291659845 UNPDF
291659845.001.png
Fast Track to Sun
Certified Java
Programmer (SCJP)
5.0 Upgrade Exam
Copyright ¨ 2006
Ka Iok 'Kent' Tong
Publisher: TipTec Development
Author's email: freemant2000@yahoo.com
Book website: http://www.agileskills2.org
Notice: All rights reserved. No part of this publication may be
reproduced, stored in a retrieval system or transmitted, in
any form or by any means, electronic, mechanical,
photocopying, recording, or otherwise, without the prior
written permission of the publisher.
ISBN: 978-1-4303-0393-0
Edition: First edition 2006
291659845.002.png
Fast Track to Sun Certified Java Programmer (SCJP) 5.0 3
Foreword
Learn the new features in Java SE 5.0
If you'd like to learn the new features in Java SE 5.0 and pass the Sun
Certified Java Programmer Upgrade Exam (CX-310-056), then this book is for
you. Why?
` It covers all the Java SE 5.0 new features covered in the exam. You don't
need to read about the features you already know.
` It is clear & concise. No need to go through hundreds of pages.
` I have passed the exam. So I know what you'll be up against.
` It includes 117 review questions and mock exam questions.
` Many working code fragments are used to show the semantics of the code
construct concerned.
` The first 30 pages are freely available on http://www.agileskills2.org. You
can judge it yourself.
Target audience and prerequisites
This book is suitable for those who would like to:
` Learn the new features in Java SE 5.0; or
` Take the Sun Certified Java Programmer Upgrade Exam.
In order to understand what's in the book, you need to know the basics of
Java. In order to take the exam, you also need to have passed a previous
version of the exam.
Acknowledgments
I'd like to thank:
` Helena Lei for proofreading this book.
` Eugenia Chan Peng U for doing the book cover and the layout design.
 
4 Fast Track to Sun Certified Java Programmer (SCJP) 5.0
Table of Contents
Foreword......................................................................................3
Learn the new features in Java SE 5.0...................................3
Target audience and prerequisites..........................................3
Acknowledgments...................................................................3
Chapter 1 Autoboxing..................................................................9
What's in this chapter?..........................................................10
Autoboxing............................................................................10
Auto unboxing.......................................................................10
Other contexts.......................................................................11
Autoboxing and method name overloading...........................11
Summary...............................................................................12
Review questions..................................................................13
Answers to review questions.................................................14
Mock exam............................................................................15
Answers to the mock exam...................................................17
Chapter 2 Generics...................................................................19
What's in this chapter?..........................................................20
Using generics.......................................................................20
Parameterized types are compile-time properties of variables..
21
Assignment compatibility between parameterized type
variables................................................................................23
Comparing a List to an array.................................................24
Wildcard type.........................................................................25
Constraining a type parameter..............................................27
Writing generic methods........................................................28
Specifying a lower bound......................................................28
Use a wildcard or a type variable?........................................29
Integrating legacy code with generic-aware code..................30
Generics and method overriding...........................................32
Generics and method name overloading..............................34
Common mistakes.................................................................34
Summary...............................................................................35
Review questions..................................................................36
Answers to review questions.................................................38
Mock exam............................................................................42
 
Zgłoś jeśli naruszono regulamin