ebook img

A programmer's guide to Java SCJP certification a comprehensive primer PDF

1089 Pages·6.211 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview A programmer's guide to Java SCJP certification a comprehensive primer

A Programmer’s Guide to Java™ SCJP Certification Third Edition This page intentionally left blank A Programmer’s Guide to Java SCJP Certification ™ A Comprehensive Primer Third Edition Khalid A. Mughal Rolf W. Rasmussen Upper Saddle River, New Jersey • Boston • Indianapolis • San Francisco New York • Toronto • Montreal • London • Munich • Paris • Madrid Capetown • Sidney • Tokyo • Singapore • Mexico City Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed with initial capital let- ters or in all capitals. The authors and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omis- sions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein. The publisher offers excellent discounts on this book when ordered in quantity for bulk pur- chases or special sales, which may include electronic versions and/or custom covers and content particular to your business, training goals, marketing focus, and branding interests. For more information, please contact: U.S. Corporate and Government Sales (800) 382-3419 [email protected] For sales outside the United States please contact: International Sales [email protected] Visit us on the Web: informit.com/aw Library of Congress Cataloging-in-Publication Data Mughal, Khalid Azim. A programmer's guide to Java SCJP certification : a comprehensive primer / Khalid A. Mughal, Rolf W. Rasmussen.—3rd ed. p. cm. Previously published under title: A programmer’s guide to Java certification. Includes bibliographical references and index. ISBN 0-321-55605-4 (pbk. : alk. paper) 1. Electronic data processing personnel--Certification. 2. Operating systems (Comput- ers)—Examinations--Study guides. 3. Java (Computer program language)--Examinations-- Study guides. I. Rasmussen, Rolf (Rolf W.) II. Mughal, Khalid Azim. Programmer’s guide to Java certification. III. Title. QA76.3.M846 2008 005.2'762--dc22 2008048822 Copyright © 2009 Pearson Education, Inc. All rights reserved. Printed in the United States of America. This publication is protected by copyright, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permissions, write to: ISBN-13: 978-0-321-55605-9 ISBN-10: 0-321-55605-4 Text printed in the United States on recycled paper at Courier in Stoughton, Massachusetts. First printing, December 2008 To the loving memory of my mother, Zubaida Begum, and my father, Mohammed Azim. —K.A.M. For Olivia E. Rasmussen and Louise J. Dahlmo. —R.W.R. This page intentionally left blank Contents Overview Foreword xxxv Preface xxxvii 1 Basics of Java Programming 1 2 Language Fundamentals 19 3 Declarations 39 4 Access Control 103 5 Operators and Expressions 159 6 Control Flow 203 7 Object-Oriented Programming 283 8 Nested Type Declarations 351 9 Object Lifetime 389 10 Fundamental Classes 423 11 Files and Streams 467 12 Localization, Pattern Matching and Formatting 531 13 Threads 613 14 Generics 661 vii viii CONTENTS 15 Collections and Maps 747 A Taking the SCJP 1.6 Exam 851 B Objectives for the SCJP 1.6 Exam 857 C Objectives for the SCJP 1.6 Upgrade Exam 863 D Annotated Answers to Review Questions 869 E Solutions to Programming Exercises 935 F Mock Exam 959 G Number Systems and Number Representation 1005 Index 1013 Contents List of Figures xxiii List of Tables xxvii List of Examples xxix Foreword xxxv Preface xxxvii 1 Basics of Java Programming 1 1.1 Introduction 2 1.2 Classes 2 Declaring Members: Fields and Methods 3 1.3 Objects 4 Class Instantiation, Reference Values, and References 4 Object Aliases 6 1.4 Instance Members 6 Invoking Methods 7 1.5 Static Members 7 1.6 Inheritance 10 1.7 Aggregation 12 1.8 Tenets of Java 13 Review Questions 13 1.9 Java Programs 15 1.10 Sample Java Application 15 Essential Elements of a Java Application 15 Compiling and Running an Application 16 Review Questions 17 Chapter Summary 18 Programming Exercise 18 ix

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.