内容简介
Chapter 1 Introduction to Java Programming
1.1 Abstraction
1.2 Development Environment and Running Environment
1.3 Programming in the Command Prompt Window
1.4 Programming in Eclipse
1.5 Java Application Structure
1.6 Code Style
1.6.1 Naming Conventions
1.6.2 Indentation and Spacing
1.6.3 Block Styles
1.7 Comments
1.8 Java and Development Tools
1.9 Foundations of Object-Oriented Programming
1.10 New Terminology
1.11 NewWords and Expressions
1.12 Hands on Lab
1.12.1 Installing JDK and Eclipse IDE
1.12.2 Programming in Command Prompt Window
1.12.3 Programming in Eclipse
1.12.4 Exporting and Importing Java Projects in Eclipse
1.13 Exercises
Chapter 2 The Basics of Java Language
2.1 Identifiers
2.2 Primitive Data Types
2.3 Literals
2.4 Variables
2.5 Operators
2.5.1 Assignment
2.5.2 Arithmetic Operators
2.5.3 Relational Operators
2.5.4 Logical Operators
2.5.5 Bitwise Operators
2.5.6 Conditional Operator
2.5.7 Operator Precedence
2.6 Expressions and Statements
2.7 The Scanner Class
2.8 Control Structures
2.8.1 Sequence Structures
2.8.2 Selection Structures
2.8.3 Repetition Structures
2.8.4 Branching Statements
2.9 Arrays
2.10 Built-in Java Classes
2.10.1 Java Strings
2.10.2 The StringBuffer Class
2.10.3 Random Numbers
2.10.4 BigInteger Objects
2.10.5 Date and Time
2.10.6 Wrapper Classes
2.11 Command Line Arguments
2.12 New Terminology
2.13 New Words and Expressions
2.14 Hands on Lab
2.14.1 Getting Input from Keyboard via ScannerClass
2.14.2 Converting String Type into int Type
2.14.3 Two-Dimensional Array of int
2.14.4 Java Strings
2.15 Exercises
Chapter 3 Classes and Objects
3.1 Class Declaration
3.2 Creating Objects
3.3 Accessing Objects via Reference Variables
3.4 Object Reference this
3.5 Parameter Passing
3.6 Returning from a Method
3.7 Method Overloading
3.8 Class Variables and Instance Variables
3.9 Class Methods and Instance Methods
3.10 The Scope of Variables
3.11 Garbage Collection
3.12 Reflection
3.13 Code Organization
3.13.1 Java API
3.13.2 Package Customs
3.14 Pattern Matching with Regular Expressions
3.15 Summary of Creating and Using Classes and Objects
3.16 New Terminology
3.17 New Words and Expressions
3.18 Hands on Lab
3.18.1 Static Variables and Instance Variables
3.18.2 Static Methods and Instance Methods
3.19 Exercises
Chapter 4 Inheritance,Interface and Polymorphism
4.1 The Concept of Inheritance
4.2 Constructors of Superclass and Subclass
4.3 Method Overriding
4.4 Upcasting and Downcasting
4.5 Abstract Class and Abstract Method
4.6 Interfaces
4.7 Polymorphism
4.8 Final Classes and Final Members
4.9 Access Control
4.10 Methods in the Object Class
4.10.1 The toString Method
4.10.2 The equals Method
4.10.3 The hashCode Method
4.10.4 The clone Method
4.11 Comparison of Objects
4.12 New Terminology
4.13 New Words and Expressions
4.14 Hands on Lab
4.14.1 Reuse Class via Inheritance
4.14.2 Constructor Calling Chain
4.14.3 Overriding Method
4.14.4 Runtime Polymorphism
4.14.5 Interface
4.14.6 Access Control
4.15 Exercises
Chapter 5 Exception Handling
5.1 Introduction
5.2 Handling Exceptions
5.3 The Finally Block
5.4 User-defined Exceptions
5.5 Benefits of Java Exception Handling Framework
5.6 Assertions
5.7 New Terminology
5.8 New Words and Expressions
5.9 Hands on Lab
5.9.1 Classpath and ClassNotFoundException
5.9.2 Catch a Runtime Exception
5.9.3 Create Your Own Exception Class
5.10 Exercises
Chapter 6 Collections Framework
6.1 Introduction
6.2 Set Interface
6.3 List Interface
6.3.1 ArrayList
6.3.2 Algorithms for List
6.4 Stack
6.5 Queue Interface
6.6 Map Interface
6.7 Generics
6.8 New Terminology
6.9 New Words and Expressions
6.10 Hands on Lab
6.10.1 View JDK Source Code in Eclipse
6.10.2 Using HashSet and TreeSet
6.10.3 Using List
6.10.4 Using Map
6.10.5 Sorting and Searching
6.11 Exercises
Chapter 7 Stream I/O
7.1 Manipulating Disk Files and Folders
7.2 Streams
7.2.1 Byte Streams
7.2.2 Buffered Byte Streams
7.2.3 Data Streams
7.2.4 Character Streams
7.2.5 Buffered Character-based I/O
7.3 Reading Values ofVarious Types by Scanner
7.4 Formatted-Text Printing with printf() Method
7.5 Object Serialization
7.6 Standard I/O and Redirection
7.7 Character Sets and Unicode
7.8 New Terminology
7.9 New Words and Expressions
7.10 Hands on Lab
7.10.1 Buffered Stream
7.10.2 DataInputStream and Data OutputStream
7.10.3 Character Stream
7.10.4 printf() Method
7.10.5 Object Serialization
7.10.6 Random Access File
7.11 Exercises
Chapter 8 Creating a GUI with JFC/Swing
8.1 Introduction
8.2 Using Swing APIs and Layout Managers
8.3 Swing Components
8.4 Component Inclusion Relationship in a GUI Application
8.5 Dialogs
8.6 Layout Management
8.7 Menus
8.8 Basic Components and Their Events
8.9 Events
8.10 MVC
8.11 New Terminology
8.12 New Words and Expressions
8.13 Hands on Lab
8.13.1 JButton
8.13.2 Action Event
8.13.3 Dialogs
8.13.4 Layout Managers
8.13.5 Focus Listener
8.13.6 Key Listener
8.13.7 Mouse Listener
8.13.8 MVC
8.14 Exercises
Chapter 9 Multithreading
9.1 Processes and Threads
9.2 Threads in Java
9.3 Thread States
9.4 Thread Scheduling and Priority
9.5 Sharing Access to Data
9.6 Synchronized Methods
9.6.1 Motivation
9.6.2 Stack with Synchronized Methods
9.6.3 Producer and Consumer Problem
9.7 Atomic Variables
9.8 Executors
9.9 Callable & Future
9.10 BlockingQueue
9.11 New Terminology
9.12 New Words and Expressions
9.13 Hands on Lab
9.13.1 Unresponsive User Interface
9.13.2 Thread Priority
9.13.3 Unsynchronized Counter
9.13.4 Volatile
9.13.5 Synchronized Methods
9.13.6 Atomic Variables
9.13.7 Executor
9.13.8 Blocking Queue
9.14 Exercises
Appendix Ⅰ Java Modifiers
Appendix Ⅱ Java Documentation
Appendix Ⅲ Unicode Chart(Basic Latin)
Appendix Ⅳ Helpful Eclipse Shortcuts
References