Scott Selikoff
Jeanne Boyarsky
Senior Acquisitions Editor: Kenyon Brown
Development Editor: David Clark
Technical Editors: Janeice DelVecchio, Elena Felder
Production Editor: Rebecca Anderson
Copy Editor: Judy Flynn
Editorial Manager: Mary Beth Wakefield
Production Manager: Kathleen Wisor
Executive Editor: Jim Minatel
Book Designer: Judy Fung and Bill Gibson
Proofreader: Nancy Carrasco
Indexer: Ted Laux
Project Coordinator, Cover: Brent Savage
Cover Designer: Wiley
Cover Image: Getty Images Inc./Jeremy Woodhouse
Copyright 2017 by John Wiley & Sons, Inc., Indianapolis, Indiana
Published simultaneously in Canada
ISBN: 978-1-119-36339-2
ISBN: 978-1-119-36336-1 (ebk.)
ISBN: 978-1-119-36340-8 (ebk.)
Manufactured in the United States of America
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, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online athttp://www.wiley.com/go/permissions.
Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or promotional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required, the services of a competent professional person should be sought. Neither the publisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Web site is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or Web site may provide or recommendations it may make. Further, readers should be aware that Internet Web sites listed in this work may have changed or disappeared between when this work was written and when it is read.
For general information on our other products and services or to obtain technical support, please contact our Customer Care Department within the U.S. at (877) 762-2974, outside the U.S. at (317) 572-3993 or fax (317) 572-4002.
Wiley publishes in a variety of print and electronic formats and by print-on-demand. Some material included with standard print versions of this book may not be included in e-books or in print-on-demand. If this book refers to media such as a CD or DVD that is not included in the version you purchased, you may download this material at http://booksupport.wiley.com. For more information about Wiley products, visit www.wiley.com.
Library of Congress Control Number: 2017931099
TRADEMARKS: Wiley, the Wiley logo, and the Sybex logo are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other countries, and may not be used without written permission. Java is a registered trademark of Oracle America, Inc. All other trademarks are the property of their respective owners. John Wiley & Sons, Inc. is not associated with any product or vendor mentioned in this book.
To the new little bundle of joy my wife is carrying.
Scott
Remembering Einstein and CV in same year. Congrats 694!
Jeanne
Acknowledgments
Scott and Jeanne would like to thank numerous individuals for their contribution to this book. Thank you to David Clark for guiding us through the process and making the book better in so many ways. Thank you to Janeice DelVecchio for being our technical editor as we wrote this book. Janeice pointed out many subtle errors in addition to the big ones. And thank you to Elena Felder for being our technical proofreader and finding the errors that we managed to sneak by Janeice. This book also wouldnt be possible without many people at Wiley, including Kenyon Brown, Rebecca Anderson, Judy Flynn, Nancy Carrasco, and so many others.
Scott could not have reached this point without the help of a small army of people, led by his perpetually understanding wife, Patti, the most wonderful mother their twin daughters, Olivia and Sophia, could ask for. Professors Johannes Gehrke and John H. Hubbard of Cornell University always believed in him and knew he would excel in his career. Scott would like to extend his gratitude to his wonderfully patient co-author Jeanne, on this their third book. I dont know how she puts up with me, but Im glad she does and thrilled at the quality of books we produce. A big thanks to Matt Dalen, who has been a great friend, sounding board, and caring father to the wonderfully sweet Olivia Dalen. Joel McNary introduced Scott to CodeRanch.com and encouraged him to post regularly, a step that changed his life. Finally, Scott would like to thank his mother and retired teacher, Barbara Selikoff, for teaching him the value of education and his father, Mark Selikoff, for instilling in him the benefits of working hard.
Jeanne would personally like to thank everyone at CodeRanch.com who asked and responded to OCA and OCP questions and comments about our first two books. Having dialog with the readers made this book even stronger. Jeanne would like to thank the members of FIRST robotics FRC team 694 in addition to FTC teams 310 and 479 for their support. Your questions make it so she can never forget what new learners are thinking. Go StuyPulse! Jeanne would also like to thank Onur Otlu and Thomas Campos for the feedback on some localization questions. Finally, Jeanne would like to thank Scott for being a great co-author and not getting tired of me.
Last but not least, both Scott and Jeanne would like to give a big thank you to the readers of our OCA 8 and OCP 8 books. Hearing from all of you who enjoyed the book and passed the exam is a great feeling. Wed also like to thank those who pointed out errors and made suggestions for improvements in our OCP book. As of December 2016, the top three were Guillaume Bailly, Thalita Vergilio, and Sbastien Canonica. We also would like to thank Olivier Chalet, Mihaela Hetea, Peter Deak, Anton Shaikin, Ramya R, Tim Moroz, Aurelien Gamet, Javid Azimli, Salim Rahal, and Sander Wamelink.
About the Authors
Scott Selikoff is a professional software consultant, author, and owner of Selikoff Solutions, LLC, which provides software development solutions to businesses in the tri-state New York City area. Skilled in a plethora of software languages and platforms, Scott specializes in full-stack database-driven systems, cloud-based applications, and service-oriented architectures.