java核心技术第一卷第十版英文版

所需积分/C币:31 2017-08-14 20:19:45 40.45MB PDF
4
收藏 收藏
举报

java核心技术第一卷第十版英文版
This page intentionally left blank Core javae Volume fundamentals Tenth edition Cay s Horstmann 88 PRENTICE HALL Boston· Columbus· Indianapolis· New york· San francisco· Amsterdam· Cape town Dubai· London· Madrid· Milan· Munich·aris· Montreal· Toronto· Delhi· Mexico City Sao paulo· Sidney· Hong Kong· Seoul Singapore· Taipei· Tokyo The author 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 omissions. 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 For information about buying this title in bulk quantities, or for special sales opportunities (which may include electronic versions; custom cover designs; and content particular to your business, training goals, marketing focus, or branding interests), please contact our corporate sales department at corpsales@pearsoned com or(800)382-3419 Forgovernmentsalesinquiriespleasecontactgovernmentsales@pearsoned.com For questions about sales outside the United States, please contact international@pearsoned.com Visit us on the Web: informit. com /ph Library of Congress Cataloging-in-Publication Data Names: Horstmann Cay S, 1959-author Title: Core Java/ Cay S Horstmann Description: Tenth edition. I New York: Prentice Hall,[2016] Includes index Identifiers: LCCN 2015038763 ISBN 9780134177304 (volume 1: pbk: alk paper) ISBN 0134177304(volume 1: pbk. alk paper Subjects: LCSH: Java(Computer program language) Classification: LCC QA7673 J38 H6753 2016 DDC 005. 13/3-dc23 Lcrecordavailableathttp://iccn.lOc.gov/2015038763 Copyright C 2016 Oracle and/ or its affiliates. All rights reserved 500 Oracle parkway, redwood Shores, CA94065 Portions c cay s horstmann 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, request forms and the appropriate contacts within the pearson education GlobalRights&PermissionsDepartmentpleasevisitwww.pearsoned.com/permissions/ Oracle America InC does not make any representations or warranties as to the accuracy, adequacy or completeness of any information contained in this work, and is not responsible for any errors or omissions. ISBN-13:9780-13-417730-4 ISBN-10:0-13-417730-4 Text printed in the United States on recycled paper at RR Donnelley in Crawfordsville, Indiana First printing, December 2015 Contents Preface… XIX Acknowledgments… Chapter 1: An Introduction to Java 1. 1 Java as a Programming Platform 1.2 The Java White Paper"Buzzwords 1.2.1 Simple… 1.2.2 Object-Oriented 1.2.3 Distributed 1.2.4 Robust 1.2.5 Secure 1.2.6 Architecture-Neutral 1.2.7 Portable 128 interpreted…… 1.2.9 High-Performance 1.2.10 Multithreaded 4445677788 1.2.11 dynamic 13 Java Applets and the Internet…… 1. 4 A Short History of Java 1.5 Common Misconceptions about Java .13 Chapter2: The Java Programming Environment…………………17 21 Installing the Java Development Kit…… 2.1.1 Downloading the JDK 18 2.1.2 Setting up the JDK 20 2.1.3 Installing Source Files and Documentation 22 22 Using the Command- Line tools…… 3 2.3 USing an Integrated Development Environment 26 2.5 Building and Running Apple on 2.4 Running a Graphical Applicatio 33 Contents Chapter 3: Fundamental Programming Structures in Javan. 41 3.1 A Simple java Program 42 3.2 Comments ∴…46 3. 3 Data Types 47 3.3.1 Integer Types 47 3.3.2 Floating-Point Types 48 3.33 The char Type… 50 3.3.4 Unicode and the char Type 51 3.3.5 The boolean Type 52 3.4 Variables .53 3.4.1 Initializing variables 54 3.4.2 Constants .55 3.5 Operators 56 3.5.1 Mathematical Functions and Constants 57 3.5.2 Conversions between Numeric Types 59 3.5.3 Casts 音垂 60 3.54 Combining Assignment with Operators……….61 3.5.5 Increment and Decrement Operators 61 3.5.6 Relational and boolean Operators 62 3.5.7 Bitwise Operators 63 3.5.8 Parentheses and Operator Hierarchy 64 3.5.9 Enumerated Types 65 3.6 Strin 65 3.6.1 Substrings ∴….66 3.6.2 Concatenation 66 3.6.3 Strings are Immutable 67 3.6.4 Testing Strings for equality ..........................................68 3.6.5 Empty and Null strings 3.6.6 Code points and code units 70 3.6.7 The String API 71 368 Reading the Online API Documentation…… 74 3.6.9 Building Strings 77 3.7 Input and output 78 3.7.1 Reading input 3.7.2 Formatting Output 82 Contents 3.7.3 File Input and output 87 3. 8 Control flow .89 3.8.1 Block Scope .89 3.8.2 Conditional Statements ∴90 3.8.3 Loops 94 3.8.4 Determinate Loops 99 3.8.5 Multiple Selections--The switch Statement 3.8.6 Statements That Break Control flow 106 3.9 Big numbers .108 3.10 Arrays 111 3.10.1 The"for each"Loop 113 3.10.2 Array Initializers and Anonymous Arrays 114 3.10.3 Array Copying 114 3.10.4 Command-Line parameters 116 3.10.5 Array Sorting 117 3.10.6 Multidimensional arrays .120 310.7 Ragged Arrays…………… …1124 Chapter4: objects and classes…,,,…,129 4.1 Introduction to Object-Oriented Programming 130 4.1.1 Classes …131 41.2 Objects… 132 4.1.3 Identifying classes …133 4.1.4 Relationships between Classes …133 4. 2 USing Predefined Classes 135 4.2. 1 Objects and object variables 136 4.2.2 The LocalDate Class of the Java library 4.2.3 Mutator and Accessor Methods ∴141 4.3 Defining Your Own Classes …145 4.3.1 An Employee Class 4.3.2 Use of Multiple Source Files 1149 4.3.3 Dissecting the Employee Class 149 4.3.4 First Steps with Constructors 150 4.3.5 Implicit and explicit parameters 152 4.3.6 Benefits of Encapsulation 153 4.3.7 Class-Based Access privileges 156 vII Contents 4.3. 8 Private Methods...............156 4.3.9 Final instance fields 157 4.4 Static Fields and Methods 158 4.4.1 Static fields 158 4.4.2 Static Constants .159 4.4.3 Static Methods 160 4.4.4 Factory Methods 161 4.4.5 The main Method 161 4.5 Method Parameters 164 4.6 Object Construction 4.6.1 Overloading… 4.6.2 Default field initialization 722 46.3 The Constructor with No arguments…… 173 4.6.4 Explicit Field Initialization 174 4.6.5 Parameter Names 175 4.6.6 Calling Another Constructor 176 4.6.7 Initialization blocks ∴177 4.6.8 Object Destruction and the finalize Method 181 4.7 Packages ∴182 4.7. 1 Class Importation 183 47.2 Static Imports…… .185 4.7.3 Addition of a Class into a package 185 4.7.4 Package Scope 189 4.8 The Class path 190 4.8.1 Setting the Class Path .193 4.9 Documentation Comments 194 4.9.1 Comment Insertion 194 4.9.2 Class Comments 195 4.9.3 Method Comments 195 4.9.4 Field comments 196 4.9.5 General Comments 196 4.9.6 Package and Overview Comments……………198 4.9.7 Comment Extraction .................................................................198 4.10 Class Design Hints 200 Contents Chapter5: Inheritance…….….………………………203 5.1( lasses, Superclasses, and subclasses………… 204 5.1.1 Defining Subclasses……… 204 5.1.2 Overriding Methods……… 206 5.1.3 Subclass constructors 207 5.1.4 Inheritance hierarchies 212 5.1.5 Polymer P hism …213 5.1.6 Understanding method calls 214 5.1.7 Preventing Inheritance: Final Classes and methods 217 5.1.8 Casting 219 5.1.9 Abstract Classes 221 5.1.10 Protected Access .227 5.2 Object: The Cosmic Superclass .228 5.2. 1 The equals Method .229 5.22 Equality Testing and Inheritance……… 231 5.2.3 The hashCode method 235 5.2. 4 The toString Method 238 5.3 Generic array lists 244 5.3.1 Accessing Array List Elements 247 5.3.2 Compatibility between Typed and Raw Array Lists .....251 54 Object Wrappers and Autoboxing…… 252 5.5 Methods with a variable number of parameters 256 5.6 Enumeration Classes…… .258 5.7 Reflection 260 5.7.1 The Class Class 261 5.7.2 A Primer on Catching Exceptions 263 5.7.3 USing reflection to analyze the capabilities of classes .. 265 5.7.4 Using reflection to analyze objects at runtime...... 271 5.75 Using reflection to Write Generic Array Code…………276 5.7.6 Invoking arbitrary Method 279 5.8 Design Hints for Inheritance 283 Chapter 6: Interfaces, Lambda Expressions, and Inner Classes mtmm. 287 6.1 Interface 288 6.1. 1 The Interface Concept… 288

...展开详情
试读 127P java核心技术第一卷第十版英文版
立即下载 低至0.43元/次 身份认证VIP会员低至7折
一个资源只可评论一次,评论内容不能少于5个字
您会向同学/朋友/同事推荐我们的CSDN下载吗?
谢谢参与!您的真实评价是我们改进的动力~
上传资源赚钱or赚积分
最新推荐
java核心技术第一卷第十版英文版 31积分/C币 立即下载
1/127
java核心技术第一卷第十版英文版第1页
java核心技术第一卷第十版英文版第2页
java核心技术第一卷第十版英文版第3页
java核心技术第一卷第十版英文版第4页
java核心技术第一卷第十版英文版第5页
java核心技术第一卷第十版英文版第6页
java核心技术第一卷第十版英文版第7页
java核心技术第一卷第十版英文版第8页
java核心技术第一卷第十版英文版第9页
java核心技术第一卷第十版英文版第10页
java核心技术第一卷第十版英文版第11页
java核心技术第一卷第十版英文版第12页
java核心技术第一卷第十版英文版第13页
java核心技术第一卷第十版英文版第14页
java核心技术第一卷第十版英文版第15页
java核心技术第一卷第十版英文版第16页
java核心技术第一卷第十版英文版第17页
java核心技术第一卷第十版英文版第18页
java核心技术第一卷第十版英文版第19页
java核心技术第一卷第十版英文版第20页

试读结束, 可继续阅读

31积分/C币 立即下载 >