21天学通Java 6 (英文高清文字版)pdf

所需积分/C币:10 2012-10-18 15:03:56 5.46MB PDF

高清文字版的 21天学通Java6 最新英文版,由人民邮电出版社出版。 内容很通俗易懂,即使英语不好也可以看得懂,内容排版和纸质版一样,这个是文字版的。里面的字可以复制出来的~推荐初学java者参照学习
Sams Teach Yourself JavaTM6 in 21 Days Acquisitions Editor Mark Taber Copyright o 2007 by Sams Publishing Development Editor All rights reserved. No part of this book shall be reproduced, stored in a retrieval system, or transmit- Songlin Qiu ted by any means, electronic, mechanical, photocopying, recording, or otherwise, without written per mission from the publisher. No patent liability is assumed with respect to the use of the information Managing Editor contained herein. Although every precaution has been taken in the preparation of this book, the pub Patrick Kanouse lisher and author assume no responsibility for errors or omissions. Nor is any liability assumed for Project Editor damages resulting from the use of the information contained herein Mandie frank International Standard Book Number-10: 0-672-32943-3 International Standard Book Number-13: 978-0-672-32943-2 Copy Editor Karen Annett Printed in the United States of america First Printing: May 2007 Indexer 10090807 4321 WordWise Publishing Services, LLC Trademarks All terms mentioned in this book that are known to be trademarks or service marks have been appro- Language Logistics in this book should not be regarded as affecting the validity of any trademark or service ma term priately capitalized. Sams Publishing cannot attest to the accuracy of this information. Use of Technical Editor Warning and Disclaimer Adam Defields Every effort has been made to make this book as complete and as accurate as possible, but no war- Publishing anty or fitness is implied. The information provided is on an"as is"basis. The author(s)and the Coordinator publisher shall have neither liability nor responsibility to any person or entity with respect to any loss Vanessa Evans or damages arising from the information contained in this book or from the use of the cd or pro- Multimedia grams accompanying it Develope Bulk sales Dan scherf Sams Publishing offers excellent discounts on this book when ordered in quantity for bulk purchases Designer or special sales. For more information, please contact Gary Adair U.S. Corporate and Government Sales Page Layout 1800-382-3419 corpsales@ pearsontechgroup com Bronkella Publishing LLC For sales outside of the U.s., please contact International sales international@ pearsoned com Library of Congress Cataloging-in-Publication Data Cadenhead, Rogers Sams teach yourself Java 6 in 21 days/Rogers Cadenhead, Laura Lemay Includes index ISBN978-0-672-32943-2(pbk.w/cd) 1. Java( Computer program language)I Lemay, Laura. Il. Title QA76.73.J38C3332007 005.133-dc22 2007014568 Contents at a Glance Introduction 1 WEEK I: The Java Language 1 Getting Started with Java 2 The ABCs of Programming 35 3 Working with Objects 63 4 Lists, Logic, and Loops 89 5 Creating Classes and Methods 115 6 Packages, Interfaces, and other Class Features 145 7 EXceptions, assertions, and Threads 183 WEEK Il: The Java class Library 8 Data structures 219 9 Working with Swing 247 10 Building a Swing Interface 273 11 Arranging Components on a User Interface 303 12 Responding to User Input 333 13 Using Color, Fonts, and Graphics 357 14 Developing Swing Applications 381 WEEK Ill: Java Programming 15 Working with Input and Output 405 16 Serializing and Examining Objects 433 17 Communicating Across the Internet 453 18 Accessing Databases with JDBC 485 19 Reading and Writing Rss Feeds 511 20 XML Web services 535 21 Writing Java servlets and Java Server Pages 555 Appendixes A Using the Java Development Kit 601 B Programming with the Java Development Kit 625 c This books web site 649 651 Bonus Material on the Companion CD-ROM CD1 Choosing Java CD2 Writing Java applets CD3 Regular Expressions CD4 Where to go from here Java resources Table of contents Introduction How This book is Who Should read This book Conventions used in This book WEEK I: The Java Language DAY 1: Getting Started with Java The Java Language History of the Language Introduction to java Selecting a development Tool Object-Oriented Programming Objects and Classes 14 Attributes and behavior 17 Attributes of a class of object Behavior of a Class of objects 18 Creating a clas Running the program 21 Organizing Classes and Class behavior 24 Inheritance 24 Creating a Class hierarchy Inheritance in action Single and multiple inheritance 30 Packa Summary 31 Q&a O 32 Questions Answers Certification practice 32 Exercises DAY 2: The ABCs of Programming 35 Statements and expressions 36 Variables and Data Types 36 Creating variables NamingⅤ ariables 39 39 assigning values to variables 41 Constants 41 Comments 43 Literals Number literals 45 Boolean literals 46 Character literals 46 String literals 47 Expressions and Operators arithmetic 4 More about assignment 51 Incrementing and Decrementing 52 Comparisons 53 Logical operators 54 Operator Precedence String arithmetic Summary O&A Quiz Questions Answers Certification Practice 60 Exercises 61 DAY 3: Working with Objects 63 Creating New Objects Usi 64 What new does A Note on Memory Management 66 Sams Teach Yourself Java 6 in 21 days Accessing and setting class and Instance variables 67 Getting values Changing values Class variables Calling methods 70 Nesting method calls Class methods 73 References to Objects 74 Casting and Converting Objects and Primitive Types 76 Casting Primitive Type Casting objects Converting Primitive Types to Objects and Vice Versa 80 Comparing object Values and Classes 82 Comparing objects 82 Determining the Class of an object 84 Summary 84 Q&a 85 Luiz 86 Questions Answers 86 Certification Practice 86 Exercises 87 DAY 4: Lists, Logic, and Loops 89 Arrays Declaring array variables Creating Array Objects 91 Accessing Array Elements Changing array elements 9 Multidimensional arrays 95 Block statements 96 f conditionals 97 switch Conditionals for loops 104 Contents while and do loops 107 while loc do-while Loops Breaking out of loops 109 Labeled Loops 110 The Conditional Operator Summary 112 Q&a 112 Quiz 112 Questions 112 answers 113 Certification Practice Exercises 114 DAY 5: Creating Classes and Methods 115 Defining classes 116 Creating Instance and class variables 116 Defining Instance variables ClassⅤ ariables 117 Creating methods 117 Defining methods 118 The this Keyword 120 Variable Scope and Method Definitions 121 Passing arguments to Methods 122 Class methods 123 Creating Java applications Helper classes 125 Java applications and command-line arguments 126 Passing Arguments to Java Applications 126 Handling Arguments in Your Java Application 127 Creating methods with the same Name, Different Arguments 128 Constructor Methods 132 Basic constructor methods 133 Calling another Constructor method 133 Overloading Constructor Methods 134 Sams Teach Yourself Java 6 in 21 days Overriding methods 136 Creating methods That Override existing methods 136 Calling the original method 137 Overriding constructors 138 Finalizer methods 140 Summary 141 Q&a 141 Quiz 142 Questions 142 Answers 143 Certification practice 143 Exercises 144 DAY 6: Packages, Interfaces, and other Class Features 145 Modifiers 146 Access Control for methods and variables 146 Static Variables and methods 152 Final classes. Methods and Variables 154 Variables 155 Methods 155 Classes 156 Abstract Classes and methods 156 157 Using packages 157 Full Package and Class names 158 The import Declaration 159 Class Name Conflicts 160 A Note about classpath and where classes Are located 161 Creating your own packages 162 Picking a package name 162 Creating the folder structure 162 Adding a Class to a Package 163 Packages and class access contro 163 nterfaces 164 The Problem of Single Inheritance Interfaces and classes 164 Contents Implementing and Using Interfaces 165 Implementing Multiple Interfaces Other Uses of interfaces 166 Creating and Extending Interfaces New interfaces 166 Methods Inside interfaces 167 Extending interfaces 168 Creating an online storefront 169 Inner classes 175 Summary 177 Q&a 178 uIZ 179 Questions 179 Answers 179 Certification Practice 179 Exercises 181 DAY 7: EXceptions, Assertions, and Threads 183 Exceptions 184 Exception Classes 186 Managing exceptions 187 Exception Consistency Checkin 188 Protecting Code and Catching Exceptions 188 The finally clause 190 Declaring Methods That Might Throw Exceptions 193 The throws clause 193 Which Exceptions Should You Throw? 194 Passing on exceptions 195 throws and Inheritance 196 Creating and Throwing Your Own Exceptions 197 Throwing Exceptions 197 Creating Your Own Exceptions 198 Combining throws try, and throw

...展开详情

评论 下载该资源后可以进行评论 3

plfay 很好,比图版的要好
2014-09-27
回复
panjunye2007 这个内容齐全,可以下载
2013-01-03
回复
w10066 不错的资源.很有用,谢谢分享.
2012-12-22
回复
img
muzili00

关注 私信 TA的资源

上传资源赚积分,得勋章
相关内容推荐
  • 下载 -

    -