Java核心技术卷I:(第9版·英文版):基础知识

Java核心技术卷I:(第9版·英文版):基础知识
分享
扫描下方二维码分享到微信
打开微信,点击右上角”+“,
使用”扫一扫“即可将网页分享到朋友圈。
作者: [美] ,
2013-07
版次: 1
ISBN: 9787115319470
定价: 109.00
装帧: 平装
开本: 16开
纸张: 胶版纸
字数: 1197千字
原版书名: Core Java Volume I—Fundamentals, Ninth Edition
14人买过
  •   《Java核心技术 卷I:基础知识(第9版?英文版)(上、下册)》是经典的《Java核心技术卷I:基础知识》的*版。这一版针对Java SE 7平台进行了全面更新,以反映Java SE 7的特性。

      书中囊括了Java的全部基础知识,提供了大量完整且具有实际意义的应用示例,详细介绍了Java语言基础、面向对象编程、反射与代理、接口与内部类、事件监听器模型、使用SwingGUI工具进行图形用户界面程序设计、打包应用程序、异常处理、登录与调试、泛型编程、集合框架、多线程等内容。

      《Java核心技术卷I:基础知识(第9版?英文版)(上、下册)》适合想将Java应用于实际项目的软件开发人员、高等院校教师和学生参考阅读。   Cay S. Horstmann 是Scala for the Impatient的作者,还与人合著了CoreJavaServer Faces。他是圣何塞州立大学计算机科学专业的教授,还是一名JavaChampion,并经常在很多开发者大会上演讲。

      Gary Cornell在编程方面拥有20多年的写作和教育经验。他是Apress的创始人之一,编写了很多与开发相关的畅销书,是Jolt大奖的获奖者之一,还荣获过VisualBasic Magazine的读者选择奖。 Preface 

    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 Network-Savvy 

    1.2.4 Robust 

    1.2.5 Secure 

    1.2.6 Architecture-Neutral 

    1.2.7 Portable 

    1.2.8 Interpreted 

    1.2.9 High-Performance 

    1.2.10 Multithreaded 

    1.2.11 Dynamic 

    1.3 Java Applets and the Internet 

    1.4 A Short History of Java 

    1.5 Common Misconceptions about Java 

    Chapter 2: The Java Programming Environment 

    2.1 Installing the Java Development Kit 

    2.1.1 Downloading the JDK 

    2.1.2 Setting the Executable Path 

    2.1.3 Installing the Library Source and Documentation 

    2.1.4 Installing the Core Java Program Examples 

    2.1.5 Navigating the Java Directories 

    2.2 Choosing a Development Environment 

    2.3 Using the Command-Line Tools 

    2.3.1 Troubleshooting Hints 

    2.4 Using an Integrated Development Environment 

    2.4.1 Locating Compilation Errors 

    2.5 Running a Graphical Application 

    2.6 Building and Running Applets 

    Chapter 3: Fundamental Programming Structures in Java 

    3.1 A Simple Java Program 

    3.2 Comments 

    3.3 Data Types 

    3.3.1 Integer Types 

    3.3.2 Floating-Point Types 

    3.3.3 The char Type 

    3.3.4 The boolean Type 

    3.4 Variables 

    3.4.1 Initializing Variables 

    3.4.2 Constants 

    3.5 Operators 

    3.5.1 Increment and Decrement Operators 

    3.5.2 Relational and boolean Operators 

    3.5.3 Bitwise Operators 

    3.5.4 Mathematical Functions and Constants 

    3.5.5 Conversions between Numeric Types 

    3.5.6 Casts 

    3.5.7 Parentheses and Operator Hierarchy 

    3.5.8 Enumerated Types 

    3.6 Strings 

    3.6.1 Substrings 

    3.6.2 Concatenation 

    3.6.3 Strings Are Immutable 

    3.6.4 Testing Strings for Equality 

    3.6.5 Empty and Null Strings 

    3.6.5 Code Points and Code Units 

    3.6.6 The String API 

    3.6.7 Reading the Online API Documentation 

    3.6.8 Building Strings 

    3.7 Input and Output 

    3.7.1 Reading Input 

    3.7.2 Formatting Output 

    3.7.3 File Input and Output 

    3.8 Control Flow 

    3.8.1 Block Scope 

    3.8.2 Conditional Statements 

    3.8.3 Loops 

    3.8.4 Determinate Loops 

    3.8.5 Multiple Selections-The switch Statement 

    3.8.6 Statements That Break Control Flow 

    3.9 Big Numbers 

    3.10 Arrays 

    3.10.1 The "for each" Loop 

    3.10.2 Array Initializers and Anonymous Arrays 

    3.10.3 Array Copying 

    3.10.4 Command-Line Parameters 

    3.10.5 Array Sorting 

    3.10.6 Multidimensional Arrays 

    3.10.7 Ragged Arrays 

    Chapter 4: Objects and Classes 

    4.1 Introduction to Object-Oriented Programming 

    4.1.1 Classes 

    4.1.2 Objects 

    4.1.3 Identifying Classes 

    4.1.4 Relationships between Classes 

    4.2 Using Predefined Classes 

    4.2.1 Objects and Object Variables 

    4.2.2 The GregorianCalendar Class of the Java Library 

    4.2.3 Mutator and Accessor Methods 

    4.3 Defining Your Own Classes 

    4.3.1 An Employee Class 

    4.3.2 Use of Multiple Source Files 

    4.3.3 Dissecting the Employee Class 

    4.3.4 First Steps with Constructors 

    4.3.5 Implicit and Explicit Parameters 

    4.3.6 Benefits of Encapsulation 

    4.3.7 Class-Based Access Privileges 

    4.3.8 Private Methods 

    4.3.9 Final Instance Fields 

    4.4 Static Fields and Methods 

    4.4.1 Static Fields 

    4.4.2 Static Constants 

    4.4.3 Static Methods 

    4.4.4 Factory Methods 

    4.4.5 The main Method 

    4.5 Method Parameters 

    4.6 Object Construction 

    4.6.1 Overloading 

    4.6.2 Default Field Initialization 

    4.6.3 The Constructor with No Arguments 

    4.6.4 Explicit Field Initialization 

    4.6.5 Parameter Names 

    4.6.6 Calling Another Constructor 

    4.6.7 Initialization Blocks 

    4.6.8 Object Destruction and the finalize Method 

    4.7 Packages 

    4.7.1 Class Importation 

    4.7.2 Static Imports 

    4.7.3 Addition of a Class into a Package 

    4.7.4 Package Scope 

    4.8 The Class Path 

    4.8.1 Setting the Class Path 

    4.9 Documentation Comments 

    4.9.1 Comment Insertion 

    4.9.2 Class Comments 

    4.9.3 Method Comments 

    4.9.4 Field Comments 

    4.9.5 General Comments 

    4.9.6 Package and Overview Comments 

    4.9.7 Comment Extraction 

    4.10 Class Design Hints 

    Chapter 5: Inheritance 

    5.1 Classes, Superclasses, and Subclasses 

    5.1.1 Inheritance Hierarchies 

    5.1.2 Polymorphism 

    5.1.3 Dynamic Binding 

    5.1.4 Preventing Inheritance: Final Classes and Methods 

    5.1.5 Casting 

    5.1.6 Abstract Classes 

    5.1.7 Protected Access 

    5.2 Object: The Cosmic Superclass 

    5.2.1 The equals Method 

    5.2.2 Equality Testing and Inheritance 

    5.2.3 The hashCode Method 

    5.2.4 The toString Method 

    5.3 Generic Array Lists 

    5.3.1 Accessing Array List Elements 

    5.3.2 Compatibility between Typed and Raw Array Lists 

    5.4 Object Wrappers and Autoboxing 

    5.5 Methods with a Variable Number of Parameters 

    5.6 Enumeration Classes 

    5.7 Reflection 

    5.7.1 The Class Class 

    5.7.2 A Primer on Catching Exceptions 

    5.7.3 Using Reflection to Analyze the Capabilities ofClasses 

    5.7.4 Using Reflection to Analyze Objects at Runtime 

    5.7.5 Using Reflection to Write Generic Array Code 

    5.7.6 Invoking Arbitrary Methods 

    5.8 Design Hints for Inheritance 

    Chapter 6: Interfaces and Inner Classes 

    6.1 Interfaces 

    6.1.1 Properties of Interfaces 

    6.1.2 Interfaces and Abstract Classes 

    6.2 Object Cloning 

    6.3 Interfaces and Callbacks 

    6.4 Inner Classes 

    6.4.1 Use of an Inner Class to Access Object State 

    6.4.2 Special Syntax Rules for Inner Classes 

    6.4.3 Are Inner Classes Useful? Actually Necessary? Secure? 

    6.4.4 Local Inner Classes 

    6.4.5 Accessing final Variables from Outer Methods 

    6.4.6 Anonymous Inner Classes 

    6.4.7 Static Inner Classes 

    6.5 Proxies 

    6.5.1 Properties of Proxy Classes 

    Chapter 7: Graphics Programming 

    7.1 Introducing Swing 

    7.2 Creating a Frame 

    7.3 Positioning a Frame 

    7.3.1 Frame Properties 

    7.3.2 Determining a Good Frame Size 

    7.4 Displaying Information in a Component 

    7.5 Working with 2D Shapes 

    7.6 Using Color 

    7.7 Using Special Fonts for Text 

    7.8 Displaying Images 

    Chapter 8: Event Handling 

    8.1 Basics of Event Handling 

    8.1.1 Example: Handling a Button Click 

    8.1.2 Becoming Comfortable with Inner Classes 

    8.1.3 Creating Listeners Containing a Single Method Call 

    8.1.4 Example: Changing the Look-and-Feel 

    8.1.5 Adapter Classes 

    8.2 Actions 

    8.3 Mouse Events 

    8.4 The AWT Event Hierarchy 

    8.4.1 Semantic and Low-Level Events 

    Chapter 9: User Interface Components with Swing 

    9.1 Swing and the Model-View-Controller Design Pattern 

    9.1.1 Design Patterns 

    9.1.2 The Model-View-Controller Pattern 

    9.1.3 A Model-View-Controller Analysis of Swing Buttons 

    9.2 Introduction to Layout Management 

    9.2.1 Border Layout 

    9.2.2 Grid Layout 

    9.3 Text Input 

    9.3.1 Text Fields 

    9.3.2 Labels and Labeling Components 

    9.3.3 Password Fields 

    9.3.4 Text Areas 

    9.3.5 Scroll Panes 

    9.4 Choice Components 

    9.4.1 Checkboxes 

    9.4.2 Radio Buttons 

    9.4.3 Borders 

    9.4.4 Combo Boxes 

    9.4.5 Sliders 

    9.5 Menus 

    9.5.1 Menu Building 

    9.5.2 Icons in Menu Items 

    9.5.3 Checkbox and Radio Button Menu Items 

    9.5.4 Pop-Up Menus 

    9.5.5 Keyboard Mnemonics and Accelerators 

    9.5.6 Enabling and Disabling Menu Items 

    9.5.7 Toolbars 

    9.5.8 Tooltips 

    9.6 Sophisticated Layout Management 

    9.6.1 The Grid Bag Layout 

    9.6.1.1 The gridx, gridy, gridwidth, and gridheightParameters 

    9.6.1.2 Weight Fields 

    9.6.1.3 The fill and anchor Parameters 

    9.6.1.4 Padding 

    9.6.1.5 Alternative Method to Specify the gridx, gridy, idwidth,andgridheight Parameters 

    9.6.1.6 A Helper Class to Tame the Grid Bag Constraints 

    9.6.2 Group Layout 

    9.6.3 Using No Layout Manager 

    9.6.4 Custom Layout Managers 

    9.6.5 Traversal Order 

    9.7 Dialog Boxes 

    9.7.1 Option Dialogs 

    9.7.2 Creating Dialogs 

    9.7.3 Data Exchange 

    9.7.4 File Dialogs 

    9.7.5 Color Choosers 

    Chapter 10: Deploying Applications and Applets 

    10.1 JAR Files 

    10.1.1 The Manifest 

    10.1.2 Executable JAR Files 

    10.1.3 Resources 

    10.1.4 Sealing 

    10.2 Java Web Start 

    10.2.1 The Sandbox 

    10.2.2 Signed Code 

    10.2.3 The JNLP API 

    10.3 Applets 

    10.3.1 A Simple Applet 

    10.3.1.1 Converting Applications to Applets 

    10.3.2 The applet HTML Tag and Its Attributes 

    10.3.3 The object Tag 

    10.3.4 Use of Parameters to Pass Information to Applets 

    10.3.5 Accessing Image and Audio Files 

    10.3.6 The Applet Context 

    10.3.6.1 Inter-Applet Communication 

    10.3.6.2 Displaying Items in the Browser 

    10.4 Storage of Application Preferences 

    10.4.1 Property Maps 

    10.4.2 The Preferences API 

    Chapter 11: Exceptions, Assertions, Logging, and Debugging 

    11.1 Dealing with Errors 

    11.1.1 The Classification of Exceptions 

    11.1.2 Declaring Checked Exceptions 

    11.1.3 How to Throw an Exception 

    11.1.4 Creating Exception Classes 

    11.2 Catching Exceptions 

    11.2.1 Catching Multiple Exceptions 

    11.2.2 Rethrowing and Chaining Exceptions 

    11.2.3 The finally Clause 

    11.2.4 The Try-with-Resources Statement 

    11.2.5 Analyzing Stack Trace Elements 

    11.3 Tips for Using Exceptions 

    11.4 Using Assertions 

    11.4.1 Assertion Enabling and Disabling 

    11.4.2 Using Assertions for Parameter Checking 

    11.4.3 Using Assertions for Documenting Assumptions 

    11.5 Logging 

    11.5.1 Basic Logging 

    11.5.2 Advanced Logging 

    11.5.3 Changing the Log Manager Configuration 

    11.5.4 Localization 

    11.5.5 Handlers 

    11.5.6 Filters 

    11.5.7 Formatters 

    11.5.8 A Logging Recipe 

    11.6 Debugging Tips 

    11.7 Tips for Troubleshooting GUI Programs 

    11.7.1 Letting the AWT Robot Do the Work 

    11.8 Using a Debugger 

    Chapter 12: Generic Programming 

    12.1 Why Generic Programming? 

    12.1.1 Who Wants to Be a Generic Programmer? 

    12.2 Defining a Simple Generic Class 

    12.3 Generic Methods 

    12.4 Bounds for Type Variables 

    12.5 Generic Code and the Virtual Machine 

    12.5.1 Translating Generic Expressions 

    12.5.2 Translating Generic Methods 

    12.5.3 Calling Legacy Code 

    12.6 Restrictions and Limitations 

    12.6.1 Type Parameters Cannot Be Instantiated with PrimitiveTypes 

    12.6.2 Runtime Type Inquiry Only Works with Raw Types 

    12.6.3 You Cannot Create Arrays of Parameterized Types 

    12.6.4 Varargs Warnings 

    12.6.5 You Cannot Instantiate Type Variables 

    12.6.6 Type Variables Are Not Valid in Static Contexts of GenericClasses 

    12.6.7 You Cannot Throw or Catch Instances of a GenericClass 

    12.6.7.1 You Can Defeat Checked Exception Checking 

    12.6.8 Beware of Clashes after Erasure 

    12.7 Inheritance Rules for Generic Types 

    12.8 Wildcard Types 

    12.8.1 Supertype Bounds for Wildcards 

    12.8.2 Unbounded Wildcards 

    12.8.3 Wildcard Capture 

    12.9 Reflection and Generics 

    12.9.1 Using Class Parameters for Type Matching 

    12.9.2 Generic Type Information in the Virtual Machine 

    Chapter 13: Collections 

    13.1 Collection Interfaces 

    13.1.1 Separating Collection Interfaces and Implementation 

    13.1.2 Collection and Iterator Interfaces in the JavaLibrary 

    13.1.2.1 Iterators 

    13.1.2.2 Removing Elements 

    13.1.2.3 Generic Utility Methods 

    13.2 Concrete Collections 

    13.2.1 Linked Lists 

    13.2.2 Array Lists 

    13.2.3 Hash Sets 

    13.2.4 Tree Sets 

    13.2.5 Object Comparison 

    13.2.6 Queues and Deques 

    13.2.7 Priority Queues 

    13.2.8 Maps 

    13.2.9 Specialized Set and Map Classes 

    13.2.9.1 Weak Hash Maps 

    13.2.9.2 Linked Hash Sets and Maps 

    13.2.9.3 Enumeration Sets and Maps 

    13.2.9.4 Identity Hash Maps 

    13.3 The Collections Framework 

    13.3.1 Views and Wrappers 

    13.3.1.1 Lightweight Collection Wrappers 

    13.3.1.2 Subranges 

    13.3.1.3 Unmodifiable Views 

    13.3.1.4 Synchronized Views 

    13.3.1.5 Checked Views 

    13.3.1.6 A Note on Optional Operations 

    13.3.2 Bulk Operations 

    13.3.3 Converting between Collections and Arrays 

    13.4 Algorithms 

    13.4.1 Sorting and Shuffling 

    13.4.2 Binary Search 

    13.4.3 Simple Algorithms 

    13.4.4 Writing Your Own Algorithms 

    13.5 Legacy Collections 

    13.5.1 The Hashtable Class 

    13.5.2 Enumerations 

    13.5.3 Property Maps 

    13.5.4 Stacks 

    13.5.5 Bit Sets 

    13.5.5.1 The "Sieve of Eratosthenes" Benchmark 

    Chapter 14: Multithreading 

    14.1 What Are Threads? 

    14.1.1 Using Threads to Give Other Tasks a Chance 

    14.2 Interrupting Threads 

    14.3 Thread States 

    14.3.1 New Threads 

    14.3.2 Runnable Threads 

    14.3.3 Blocked and Waiting Threads 

    14.3.4 Terminated Threads 

    14.4 Thread Properties 

    14.4.1 Thread Priorities 

    14.4.2 Daemon Threads 

    14.4.3 Handlers for Uncaught Exceptions 

    14.5 Synchronization 

    14.5.1 An Example of a Race Condition 

    14.5.2 The Race Condition Explained 

    14.5.3 Lock Objects 

    14.5.4 Condition Objects 

    14.5.5 The synchronized Keyword 

    14.5.6 Synchronized Blocks 

    14.5.7 The Monitor Concept 

    14.5.8 Volatile Fields 

    14.5.9 Final Variables 

    14.5.10 Atomics 

    14.5.11 Deadlocks 

    14.5.12 Thread-Local Variables 

    14.5.13 Lock Testing and Timeouts 

    14.5.14 Read/Write Locks 

    14.5.15 Why the stop and suspend Methods Are Deprecated 

    14.6 Blocking Queues 

    14.7 Thread-Safe Collections 

    14.7.1 Efficient Maps, Sets, and Queues 

    14.7.2 Copy on Write Arrays 

    14.7.3 Older Thread-Safe Collections 

    14.8 Callables and Futures 

    14.9 Executors 

    14.9.1 Thread Pools 

    14.9.2 Scheduled Execution 

    14.9.3 Controlling Groups of Tasks 

    14.9.4 The Fork-Join Framework 

    14.10 Synchronizers 

    14.10.1 Semaphores 

    14.10.2 Countdown Latches 

    14.10.3 Barriers 

    14.10.4 Exchangers 

    14.10.5 Synchronous Queues 

    14.11 Threads and Swing 

    14.11.1 Running Time-Consuming Tasks 

    14.11.2 Using the Swing Worker 

    14.11.3 The Single-Thread Rule 

    Appendix: Java Keywords 

    Index
  • 内容简介:
      《Java核心技术 卷I:基础知识(第9版?英文版)(上、下册)》是经典的《Java核心技术卷I:基础知识》的*版。这一版针对Java SE 7平台进行了全面更新,以反映Java SE 7的特性。

      书中囊括了Java的全部基础知识,提供了大量完整且具有实际意义的应用示例,详细介绍了Java语言基础、面向对象编程、反射与代理、接口与内部类、事件监听器模型、使用SwingGUI工具进行图形用户界面程序设计、打包应用程序、异常处理、登录与调试、泛型编程、集合框架、多线程等内容。

      《Java核心技术卷I:基础知识(第9版?英文版)(上、下册)》适合想将Java应用于实际项目的软件开发人员、高等院校教师和学生参考阅读。
  • 作者简介:
      Cay S. Horstmann 是Scala for the Impatient的作者,还与人合著了CoreJavaServer Faces。他是圣何塞州立大学计算机科学专业的教授,还是一名JavaChampion,并经常在很多开发者大会上演讲。

      Gary Cornell在编程方面拥有20多年的写作和教育经验。他是Apress的创始人之一,编写了很多与开发相关的畅销书,是Jolt大奖的获奖者之一,还荣获过VisualBasic Magazine的读者选择奖。
  • 目录:
    Preface 

    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 Network-Savvy 

    1.2.4 Robust 

    1.2.5 Secure 

    1.2.6 Architecture-Neutral 

    1.2.7 Portable 

    1.2.8 Interpreted 

    1.2.9 High-Performance 

    1.2.10 Multithreaded 

    1.2.11 Dynamic 

    1.3 Java Applets and the Internet 

    1.4 A Short History of Java 

    1.5 Common Misconceptions about Java 

    Chapter 2: The Java Programming Environment 

    2.1 Installing the Java Development Kit 

    2.1.1 Downloading the JDK 

    2.1.2 Setting the Executable Path 

    2.1.3 Installing the Library Source and Documentation 

    2.1.4 Installing the Core Java Program Examples 

    2.1.5 Navigating the Java Directories 

    2.2 Choosing a Development Environment 

    2.3 Using the Command-Line Tools 

    2.3.1 Troubleshooting Hints 

    2.4 Using an Integrated Development Environment 

    2.4.1 Locating Compilation Errors 

    2.5 Running a Graphical Application 

    2.6 Building and Running Applets 

    Chapter 3: Fundamental Programming Structures in Java 

    3.1 A Simple Java Program 

    3.2 Comments 

    3.3 Data Types 

    3.3.1 Integer Types 

    3.3.2 Floating-Point Types 

    3.3.3 The char Type 

    3.3.4 The boolean Type 

    3.4 Variables 

    3.4.1 Initializing Variables 

    3.4.2 Constants 

    3.5 Operators 

    3.5.1 Increment and Decrement Operators 

    3.5.2 Relational and boolean Operators 

    3.5.3 Bitwise Operators 

    3.5.4 Mathematical Functions and Constants 

    3.5.5 Conversions between Numeric Types 

    3.5.6 Casts 

    3.5.7 Parentheses and Operator Hierarchy 

    3.5.8 Enumerated Types 

    3.6 Strings 

    3.6.1 Substrings 

    3.6.2 Concatenation 

    3.6.3 Strings Are Immutable 

    3.6.4 Testing Strings for Equality 

    3.6.5 Empty and Null Strings 

    3.6.5 Code Points and Code Units 

    3.6.6 The String API 

    3.6.7 Reading the Online API Documentation 

    3.6.8 Building Strings 

    3.7 Input and Output 

    3.7.1 Reading Input 

    3.7.2 Formatting Output 

    3.7.3 File Input and Output 

    3.8 Control Flow 

    3.8.1 Block Scope 

    3.8.2 Conditional Statements 

    3.8.3 Loops 

    3.8.4 Determinate Loops 

    3.8.5 Multiple Selections-The switch Statement 

    3.8.6 Statements That Break Control Flow 

    3.9 Big Numbers 

    3.10 Arrays 

    3.10.1 The "for each" Loop 

    3.10.2 Array Initializers and Anonymous Arrays 

    3.10.3 Array Copying 

    3.10.4 Command-Line Parameters 

    3.10.5 Array Sorting 

    3.10.6 Multidimensional Arrays 

    3.10.7 Ragged Arrays 

    Chapter 4: Objects and Classes 

    4.1 Introduction to Object-Oriented Programming 

    4.1.1 Classes 

    4.1.2 Objects 

    4.1.3 Identifying Classes 

    4.1.4 Relationships between Classes 

    4.2 Using Predefined Classes 

    4.2.1 Objects and Object Variables 

    4.2.2 The GregorianCalendar Class of the Java Library 

    4.2.3 Mutator and Accessor Methods 

    4.3 Defining Your Own Classes 

    4.3.1 An Employee Class 

    4.3.2 Use of Multiple Source Files 

    4.3.3 Dissecting the Employee Class 

    4.3.4 First Steps with Constructors 

    4.3.5 Implicit and Explicit Parameters 

    4.3.6 Benefits of Encapsulation 

    4.3.7 Class-Based Access Privileges 

    4.3.8 Private Methods 

    4.3.9 Final Instance Fields 

    4.4 Static Fields and Methods 

    4.4.1 Static Fields 

    4.4.2 Static Constants 

    4.4.3 Static Methods 

    4.4.4 Factory Methods 

    4.4.5 The main Method 

    4.5 Method Parameters 

    4.6 Object Construction 

    4.6.1 Overloading 

    4.6.2 Default Field Initialization 

    4.6.3 The Constructor with No Arguments 

    4.6.4 Explicit Field Initialization 

    4.6.5 Parameter Names 

    4.6.6 Calling Another Constructor 

    4.6.7 Initialization Blocks 

    4.6.8 Object Destruction and the finalize Method 

    4.7 Packages 

    4.7.1 Class Importation 

    4.7.2 Static Imports 

    4.7.3 Addition of a Class into a Package 

    4.7.4 Package Scope 

    4.8 The Class Path 

    4.8.1 Setting the Class Path 

    4.9 Documentation Comments 

    4.9.1 Comment Insertion 

    4.9.2 Class Comments 

    4.9.3 Method Comments 

    4.9.4 Field Comments 

    4.9.5 General Comments 

    4.9.6 Package and Overview Comments 

    4.9.7 Comment Extraction 

    4.10 Class Design Hints 

    Chapter 5: Inheritance 

    5.1 Classes, Superclasses, and Subclasses 

    5.1.1 Inheritance Hierarchies 

    5.1.2 Polymorphism 

    5.1.3 Dynamic Binding 

    5.1.4 Preventing Inheritance: Final Classes and Methods 

    5.1.5 Casting 

    5.1.6 Abstract Classes 

    5.1.7 Protected Access 

    5.2 Object: The Cosmic Superclass 

    5.2.1 The equals Method 

    5.2.2 Equality Testing and Inheritance 

    5.2.3 The hashCode Method 

    5.2.4 The toString Method 

    5.3 Generic Array Lists 

    5.3.1 Accessing Array List Elements 

    5.3.2 Compatibility between Typed and Raw Array Lists 

    5.4 Object Wrappers and Autoboxing 

    5.5 Methods with a Variable Number of Parameters 

    5.6 Enumeration Classes 

    5.7 Reflection 

    5.7.1 The Class Class 

    5.7.2 A Primer on Catching Exceptions 

    5.7.3 Using Reflection to Analyze the Capabilities ofClasses 

    5.7.4 Using Reflection to Analyze Objects at Runtime 

    5.7.5 Using Reflection to Write Generic Array Code 

    5.7.6 Invoking Arbitrary Methods 

    5.8 Design Hints for Inheritance 

    Chapter 6: Interfaces and Inner Classes 

    6.1 Interfaces 

    6.1.1 Properties of Interfaces 

    6.1.2 Interfaces and Abstract Classes 

    6.2 Object Cloning 

    6.3 Interfaces and Callbacks 

    6.4 Inner Classes 

    6.4.1 Use of an Inner Class to Access Object State 

    6.4.2 Special Syntax Rules for Inner Classes 

    6.4.3 Are Inner Classes Useful? Actually Necessary? Secure? 

    6.4.4 Local Inner Classes 

    6.4.5 Accessing final Variables from Outer Methods 

    6.4.6 Anonymous Inner Classes 

    6.4.7 Static Inner Classes 

    6.5 Proxies 

    6.5.1 Properties of Proxy Classes 

    Chapter 7: Graphics Programming 

    7.1 Introducing Swing 

    7.2 Creating a Frame 

    7.3 Positioning a Frame 

    7.3.1 Frame Properties 

    7.3.2 Determining a Good Frame Size 

    7.4 Displaying Information in a Component 

    7.5 Working with 2D Shapes 

    7.6 Using Color 

    7.7 Using Special Fonts for Text 

    7.8 Displaying Images 

    Chapter 8: Event Handling 

    8.1 Basics of Event Handling 

    8.1.1 Example: Handling a Button Click 

    8.1.2 Becoming Comfortable with Inner Classes 

    8.1.3 Creating Listeners Containing a Single Method Call 

    8.1.4 Example: Changing the Look-and-Feel 

    8.1.5 Adapter Classes 

    8.2 Actions 

    8.3 Mouse Events 

    8.4 The AWT Event Hierarchy 

    8.4.1 Semantic and Low-Level Events 

    Chapter 9: User Interface Components with Swing 

    9.1 Swing and the Model-View-Controller Design Pattern 

    9.1.1 Design Patterns 

    9.1.2 The Model-View-Controller Pattern 

    9.1.3 A Model-View-Controller Analysis of Swing Buttons 

    9.2 Introduction to Layout Management 

    9.2.1 Border Layout 

    9.2.2 Grid Layout 

    9.3 Text Input 

    9.3.1 Text Fields 

    9.3.2 Labels and Labeling Components 

    9.3.3 Password Fields 

    9.3.4 Text Areas 

    9.3.5 Scroll Panes 

    9.4 Choice Components 

    9.4.1 Checkboxes 

    9.4.2 Radio Buttons 

    9.4.3 Borders 

    9.4.4 Combo Boxes 

    9.4.5 Sliders 

    9.5 Menus 

    9.5.1 Menu Building 

    9.5.2 Icons in Menu Items 

    9.5.3 Checkbox and Radio Button Menu Items 

    9.5.4 Pop-Up Menus 

    9.5.5 Keyboard Mnemonics and Accelerators 

    9.5.6 Enabling and Disabling Menu Items 

    9.5.7 Toolbars 

    9.5.8 Tooltips 

    9.6 Sophisticated Layout Management 

    9.6.1 The Grid Bag Layout 

    9.6.1.1 The gridx, gridy, gridwidth, and gridheightParameters 

    9.6.1.2 Weight Fields 

    9.6.1.3 The fill and anchor Parameters 

    9.6.1.4 Padding 

    9.6.1.5 Alternative Method to Specify the gridx, gridy, idwidth,andgridheight Parameters 

    9.6.1.6 A Helper Class to Tame the Grid Bag Constraints 

    9.6.2 Group Layout 

    9.6.3 Using No Layout Manager 

    9.6.4 Custom Layout Managers 

    9.6.5 Traversal Order 

    9.7 Dialog Boxes 

    9.7.1 Option Dialogs 

    9.7.2 Creating Dialogs 

    9.7.3 Data Exchange 

    9.7.4 File Dialogs 

    9.7.5 Color Choosers 

    Chapter 10: Deploying Applications and Applets 

    10.1 JAR Files 

    10.1.1 The Manifest 

    10.1.2 Executable JAR Files 

    10.1.3 Resources 

    10.1.4 Sealing 

    10.2 Java Web Start 

    10.2.1 The Sandbox 

    10.2.2 Signed Code 

    10.2.3 The JNLP API 

    10.3 Applets 

    10.3.1 A Simple Applet 

    10.3.1.1 Converting Applications to Applets 

    10.3.2 The applet HTML Tag and Its Attributes 

    10.3.3 The object Tag 

    10.3.4 Use of Parameters to Pass Information to Applets 

    10.3.5 Accessing Image and Audio Files 

    10.3.6 The Applet Context 

    10.3.6.1 Inter-Applet Communication 

    10.3.6.2 Displaying Items in the Browser 

    10.4 Storage of Application Preferences 

    10.4.1 Property Maps 

    10.4.2 The Preferences API 

    Chapter 11: Exceptions, Assertions, Logging, and Debugging 

    11.1 Dealing with Errors 

    11.1.1 The Classification of Exceptions 

    11.1.2 Declaring Checked Exceptions 

    11.1.3 How to Throw an Exception 

    11.1.4 Creating Exception Classes 

    11.2 Catching Exceptions 

    11.2.1 Catching Multiple Exceptions 

    11.2.2 Rethrowing and Chaining Exceptions 

    11.2.3 The finally Clause 

    11.2.4 The Try-with-Resources Statement 

    11.2.5 Analyzing Stack Trace Elements 

    11.3 Tips for Using Exceptions 

    11.4 Using Assertions 

    11.4.1 Assertion Enabling and Disabling 

    11.4.2 Using Assertions for Parameter Checking 

    11.4.3 Using Assertions for Documenting Assumptions 

    11.5 Logging 

    11.5.1 Basic Logging 

    11.5.2 Advanced Logging 

    11.5.3 Changing the Log Manager Configuration 

    11.5.4 Localization 

    11.5.5 Handlers 

    11.5.6 Filters 

    11.5.7 Formatters 

    11.5.8 A Logging Recipe 

    11.6 Debugging Tips 

    11.7 Tips for Troubleshooting GUI Programs 

    11.7.1 Letting the AWT Robot Do the Work 

    11.8 Using a Debugger 

    Chapter 12: Generic Programming 

    12.1 Why Generic Programming? 

    12.1.1 Who Wants to Be a Generic Programmer? 

    12.2 Defining a Simple Generic Class 

    12.3 Generic Methods 

    12.4 Bounds for Type Variables 

    12.5 Generic Code and the Virtual Machine 

    12.5.1 Translating Generic Expressions 

    12.5.2 Translating Generic Methods 

    12.5.3 Calling Legacy Code 

    12.6 Restrictions and Limitations 

    12.6.1 Type Parameters Cannot Be Instantiated with PrimitiveTypes 

    12.6.2 Runtime Type Inquiry Only Works with Raw Types 

    12.6.3 You Cannot Create Arrays of Parameterized Types 

    12.6.4 Varargs Warnings 

    12.6.5 You Cannot Instantiate Type Variables 

    12.6.6 Type Variables Are Not Valid in Static Contexts of GenericClasses 

    12.6.7 You Cannot Throw or Catch Instances of a GenericClass 

    12.6.7.1 You Can Defeat Checked Exception Checking 

    12.6.8 Beware of Clashes after Erasure 

    12.7 Inheritance Rules for Generic Types 

    12.8 Wildcard Types 

    12.8.1 Supertype Bounds for Wildcards 

    12.8.2 Unbounded Wildcards 

    12.8.3 Wildcard Capture 

    12.9 Reflection and Generics 

    12.9.1 Using Class Parameters for Type Matching 

    12.9.2 Generic Type Information in the Virtual Machine 

    Chapter 13: Collections 

    13.1 Collection Interfaces 

    13.1.1 Separating Collection Interfaces and Implementation 

    13.1.2 Collection and Iterator Interfaces in the JavaLibrary 

    13.1.2.1 Iterators 

    13.1.2.2 Removing Elements 

    13.1.2.3 Generic Utility Methods 

    13.2 Concrete Collections 

    13.2.1 Linked Lists 

    13.2.2 Array Lists 

    13.2.3 Hash Sets 

    13.2.4 Tree Sets 

    13.2.5 Object Comparison 

    13.2.6 Queues and Deques 

    13.2.7 Priority Queues 

    13.2.8 Maps 

    13.2.9 Specialized Set and Map Classes 

    13.2.9.1 Weak Hash Maps 

    13.2.9.2 Linked Hash Sets and Maps 

    13.2.9.3 Enumeration Sets and Maps 

    13.2.9.4 Identity Hash Maps 

    13.3 The Collections Framework 

    13.3.1 Views and Wrappers 

    13.3.1.1 Lightweight Collection Wrappers 

    13.3.1.2 Subranges 

    13.3.1.3 Unmodifiable Views 

    13.3.1.4 Synchronized Views 

    13.3.1.5 Checked Views 

    13.3.1.6 A Note on Optional Operations 

    13.3.2 Bulk Operations 

    13.3.3 Converting between Collections and Arrays 

    13.4 Algorithms 

    13.4.1 Sorting and Shuffling 

    13.4.2 Binary Search 

    13.4.3 Simple Algorithms 

    13.4.4 Writing Your Own Algorithms 

    13.5 Legacy Collections 

    13.5.1 The Hashtable Class 

    13.5.2 Enumerations 

    13.5.3 Property Maps 

    13.5.4 Stacks 

    13.5.5 Bit Sets 

    13.5.5.1 The "Sieve of Eratosthenes" Benchmark 

    Chapter 14: Multithreading 

    14.1 What Are Threads? 

    14.1.1 Using Threads to Give Other Tasks a Chance 

    14.2 Interrupting Threads 

    14.3 Thread States 

    14.3.1 New Threads 

    14.3.2 Runnable Threads 

    14.3.3 Blocked and Waiting Threads 

    14.3.4 Terminated Threads 

    14.4 Thread Properties 

    14.4.1 Thread Priorities 

    14.4.2 Daemon Threads 

    14.4.3 Handlers for Uncaught Exceptions 

    14.5 Synchronization 

    14.5.1 An Example of a Race Condition 

    14.5.2 The Race Condition Explained 

    14.5.3 Lock Objects 

    14.5.4 Condition Objects 

    14.5.5 The synchronized Keyword 

    14.5.6 Synchronized Blocks 

    14.5.7 The Monitor Concept 

    14.5.8 Volatile Fields 

    14.5.9 Final Variables 

    14.5.10 Atomics 

    14.5.11 Deadlocks 

    14.5.12 Thread-Local Variables 

    14.5.13 Lock Testing and Timeouts 

    14.5.14 Read/Write Locks 

    14.5.15 Why the stop and suspend Methods Are Deprecated 

    14.6 Blocking Queues 

    14.7 Thread-Safe Collections 

    14.7.1 Efficient Maps, Sets, and Queues 

    14.7.2 Copy on Write Arrays 

    14.7.3 Older Thread-Safe Collections 

    14.8 Callables and Futures 

    14.9 Executors 

    14.9.1 Thread Pools 

    14.9.2 Scheduled Execution 

    14.9.3 Controlling Groups of Tasks 

    14.9.4 The Fork-Join Framework 

    14.10 Synchronizers 

    14.10.1 Semaphores 

    14.10.2 Countdown Latches 

    14.10.3 Barriers 

    14.10.4 Exchangers 

    14.10.5 Synchronous Queues 

    14.11 Threads and Swing 

    14.11.1 Running Time-Consuming Tasks 

    14.11.2 Using the Swing Worker 

    14.11.3 The Single-Thread Rule 

    Appendix: Java Keywords 

    Index
查看详情
相关图书 / 更多
Java核心技术卷I:(第9版·英文版):基础知识
Java程序设计任务驱动教程
黑马程序员
Java核心技术卷I:(第9版·英文版):基础知识
Java研发自测入门与进阶
林宁、魏兆玉
Java核心技术卷I:(第9版·英文版):基础知识
Java语言程序设计(2023年版)全国高等教育自学考试指导委员会
全国高等教育自学考试指导委员会
Java核心技术卷I:(第9版·英文版):基础知识
Java+OpenCV案例佳作选
姚利民
Java核心技术卷I:(第9版·英文版):基础知识
Java核心编程技术(第4版微课版新世纪应用型高等教育软件专业系列规划教材)
张屹、蔡木生 编
Java核心技术卷I:(第9版·英文版):基础知识
Java程序设计及实践应用研究
张萌,梁正,李真
Java核心技术卷I:(第9版·英文版):基础知识
Java Web及其框架技术
陈振兴
Java核心技术卷I:(第9版·英文版):基础知识
JavaScript多线程编程实践
(美)托马斯 亨特二世(Thomas Hunter II),(加拿大)布莱恩 英格利什(Bryan English)
Java核心技术卷I:(第9版·英文版):基础知识
Java开发坑点解析:从根因分析到最佳实践
朱晔
Java核心技术卷I:(第9版·英文版):基础知识
Java面向对象程序设计(题库·微课视频版)
梁胜彬 主编 渠慎明 白晨希 马华蔚 甘志华 程素营 副主编
Java核心技术卷I:(第9版·英文版):基础知识
Java程序设计(微课版新世纪应用型高等教育计算机类课程规划教材)
李月辉、李慧 编
Java核心技术卷I:(第9版·英文版):基础知识
Java到Kotlin:代码重构指南
(英)邓肯·麦格雷戈(Duncan McGregor)
您可能感兴趣 / 更多
Java核心技术卷I:(第9版·英文版):基础知识
明信片(《断背山》作者又一力作,荣获福克纳文学奖,49张明信片背后是100种离奇人生)
[美]安妮·普鲁 著;黄宜思 译
Java核心技术卷I:(第9版·英文版):基础知识
欲望行星:人类时代的地球
[美]唐纳德·沃斯特(Donald Worster) 著;侯深 译;汉唐阳光 出品
Java核心技术卷I:(第9版·英文版):基础知识
超大规模集成电路物理设计:从图分割到时序收敛(原书第2版) [美国]安德·B.卡恩
[美]安德·B.卡恩
Java核心技术卷I:(第9版·英文版):基础知识
海外中国研究·文化、权力与国家:1900—1942年的华北农村(海外中国研究丛书精选版第四辑)
[美]杜赞奇 著;王福明 译
Java核心技术卷I:(第9版·英文版):基础知识
全新正版图书 改变世界的6种力亨利·波卓斯基浙江科学技术出版社9787573910929
[美] 亨利·波卓斯基
Java核心技术卷I:(第9版·英文版):基础知识
(守望者·传记)身体的疯狂朝圣:田纳西·威廉斯传
[美]约翰·拉尔 著;张敏 凌建娥 译
Java核心技术卷I:(第9版·英文版):基础知识
哥白尼
[美]欧文·金格里奇(Owen Gingerich)
Java核心技术卷I:(第9版·英文版):基础知识
玻璃底片上的宇宙
[美]达娃·索贝尔 后浪
Java核心技术卷I:(第9版·英文版):基础知识
数学侦探 珠宝行里的X劫匪
[美]丹尼尔·肯尼 艾米丽·博艾尔 著 刘玙婧、王婧 译;小博集出品
Java核心技术卷I:(第9版·英文版):基础知识
十大经济学家
[美]约瑟夫·熊彼特
Java核心技术卷I:(第9版·英文版):基础知识
闲散一些也无可厚非
[美]艾莉森·孙 著;李昂 译
Java核心技术卷I:(第9版·英文版):基础知识
Java 2核心技术(卷Ⅱ):高级特性
[美]Cay S. Horstmann;Gary Cornell