upload/misc/Y9EgLx762wKqWqG7nloH/Books/Gentoomen Library/Programming/Java/Java(tm)2 - ISBN 0072225882.pdf
Java? 2: A Beginner?s Guide 🔍
Herbert Schildt; NetLibrary, Inc
McGraw-Hill Osborne Media, 2nd ed, New York, 2002
英语 [en] · PDF · 2.6MB · 2002 · 📘 非小说类图书 · 🚀/lgli/lgrs/nexusstc/upload/zlib · Save
描述
In the space of a few short years, Java went from relative obscurity to being the most important language of the Internet. The impact of Java cannot be understated. It transformed the Web into a highly interactive environment, setting a new standard in computer language design in the process. The innovative aspects of Java have already changed the course of programming well into the foreseeable future. Therefore, if Internet-based programming is in your future, you have chosen the right language to learn?and this book will help you learn it.
The purpose of this book is to teach you the fundamentals of Java programming. It uses a step-by-step approach complete with numerous examples, self-tests, and projects. It assumes no previous programming experience. The book starts with the basics, such as how to compile and run a Java program. It then discusses every keyword in the Java language. It concludes with some of Java?s most advanced features, such as multithreaded programming and creating applets. By the time you finish, you will have a firm grasp of the essentials of Java programming.
It is important to state at the outset that this book is just a starting point. Java is more than just the elements that define the language. Java also includes extensive libraries and tools that aid in the development of programs. Furthermore, Java provides a sophisticated set of libraries that handle the browser user interface. To be a top-notch Java programmer implies mastery of these areas, too. After completing this book you will have the knowledge to pursue any and all other aspects of Java.
В связи с малым количеством литературы по Java публикую этот самоучитель. Книга предназначена для начинающих. Написано очень простым языком, как с точки зрения понимания самого программирования, так и с точки зрения понимания английского текста.
Самоучитель скачен из сети P2P!
The purpose of this book is to teach you the fundamentals of Java programming. It uses a step-by-step approach complete with numerous examples, self-tests, and projects. It assumes no previous programming experience. The book starts with the basics, such as how to compile and run a Java program. It then discusses every keyword in the Java language. It concludes with some of Java?s most advanced features, such as multithreaded programming and creating applets. By the time you finish, you will have a firm grasp of the essentials of Java programming.
It is important to state at the outset that this book is just a starting point. Java is more than just the elements that define the language. Java also includes extensive libraries and tools that aid in the development of programs. Furthermore, Java provides a sophisticated set of libraries that handle the browser user interface. To be a top-notch Java programmer implies mastery of these areas, too. After completing this book you will have the knowledge to pursue any and all other aspects of Java.
В связи с малым количеством литературы по Java публикую этот самоучитель. Книга предназначена для начинающих. Написано очень простым языком, как с точки зрения понимания самого программирования, так и с точки зрения понимания английского текста.
Самоучитель скачен из сети P2P!
备用文件名
lgli/dvd48/Schildt H. - Java 2. A Beginners Guide(2003)(second edition)(520).pdf
备用文件名
lgrsnf/dvd48/Schildt H. - Java 2. A Beginners Guide(2003)(second edition)(520).pdf
备用文件名
nexusstc/Java 2 - A Beginner's Guide/8d60bf72bd2ec75a93beab1237314a8f.pdf
备用文件名
zlib/Computers/Programming/Herbert Schildt/Java 2: A Beginner's Guide_491076.pdf
备选标题
Java(tm)2: A Beginner's Guide
备选标题
Java 2 complete. dt
备选标题
Java 2 - das Buch
备选标题
Java 2TM
备选标题
Java two
备选作者
J. Zukowski ... [U bers.: Gerald Schu ler ...]
备选作者
Herbert Schildt, Herb Schildt
备选作者
Schildt, Herbert
备选作者
Steven Holzner
备选作者
John Zukowski
备用出版商
McGraw-Hill School Education Group
备用出版商
Irwin Professional Publishing
备用出版商
McGraw-Hill Professional
备用出版商
McGraw-Hill Publishing
备用出版商
Osborne/McGraw-Hill
备用出版商
Apollo Medien GmbH
备用出版商
Oracle Press
备用出版商
Sybex
备用版本
Das Buch : viel Wissen, 1. Aufl., Du sseldorf, Germany, 2001
备用版本
McGraw Hill LLC Professional Division, New York, 2003
备用版本
Essential skills made easy, 2nd ed, New York, ©2003
备用版本
Essential skills made easy, 2nd ed, New York, c2003
备用版本
Das Buch : viel Wissen, 1. Aufl, Düsseldorf, 2001
备用版本
2nd ed., New York, New York State, 2003
备用版本
United States, United States of America
备用版本
2 edition, November 25, 2002
备用版本
2d ed, Berkeley, Calif, 2002
备用版本
Germany, Germany
备用版本
2nd, 2002-11-25
备用版本
2, 20021216
元数据中的注释
mexmat -- 48
元数据中的注释
lg153629
元数据中的注释
producers:
Acrobat Distiller 4.0 for Windows
Acrobat Distiller 4.0 for Windows
元数据中的注释
{"edition":"2","isbns":["0072225882","007223041X","3815500125","9780072225884","9780072230413","9783815500125"],"last_page":545,"publisher":"McGraw-Hill"}
元数据中的注释
Includes bibliographical references and index.
备用描述
Cover......Page 1
Contents at a Glance......Page 8
Contents......Page 10
Preface......Page 20
Java Fundamentals......Page 24
The Origins of Java......Page 25
How Java Relates to C and C++......Page 26
Progress Check......Page 27
Security......Page 28
Java’s Magic: The Bytecode......Page 29
The Java Buzzwords......Page 30
Object- Oriented Programming......Page 31
Encapsulation......Page 32
Inheritance......Page 33
Ask the Expert......Page 34
A First Simple Program......Page 35
Compiling the Program......Page 36
The First Sample Program Line by Line......Page 37
Progress Check......Page 39
A Second Simple Program......Page 40
Another Data Type......Page 43
Ask the Expert......Page 44
The if Statement......Page 46
The for Loop......Page 48
Create Blocks of Code......Page 50
Ask the Expert......Page 51
Indentation Practices......Page 52
Progress Check......Page 53
Identifiers in Java......Page 55
The Java Class Libraries......Page 56
Introducing Data Types and Operators......Page 58
Java’s Simple Types......Page 59
Integers......Page 60
Floating- Point Types......Page 61
Ask the Expert......Page 62
Characters......Page 63
The Boolean Type......Page 64
Progress Check......Page 65
Hexadecimal and Octal Constants......Page 67
String Literals......Page 68
Progress Check......Page 69
Initializing a Variable......Page 70
Dynamic Initialization......Page 71
Arithmetic Operators......Page 75
Increment and Decrement......Page 77
Relational and Logical Operators......Page 78
Short- Circuit Logical Operators......Page 80
The Assignment Operator......Page 81
Ask the Expert......Page 82
Casting Incompatible Types......Page 85
Operator Precedence......Page 87
Type Conversion in Expressions......Page 89
Spacing and Parentheses......Page 91
Program Control Statements......Page 94
Input Characters from the Keyboard......Page 95
Progress Check......Page 96
The if Statement......Page 97
Nested ifs......Page 98
The if- else- if Ladder......Page 99
The switch Statement......Page 101
Progress Check......Page 105
Ask the Expert......Page 108
The for Loop......Page 109
Some Variations on the for Loop......Page 110
Missing Pieces......Page 111
Loops with No Body......Page 113
Declaring Loop Control Variables Inside the for Loop......Page 114
The while Loop......Page 115
The do- while Loop......Page 117
Progress Check......Page 119
Use break to Exit a Loop......Page 123
Use break as a Form of goto......Page 125
Use continue......Page 129
Progress Check......Page 131
Nested Loops......Page 135
Introducing Classes, Objects, and Methods......Page 138
The General Form of a Class......Page 139
Defining a Class......Page 140
Progress Check......Page 143
Reference Variables and Assignment......Page 144
Methods......Page 145
Adding a Method to the Vehicle Class......Page 146
Adding a Parameterized Method to Vehicle......Page 153
Progress Check......Page 155
Adding a Constructor to the Vehicle Class......Page 164
The new Operator Revisited......Page 165
Garbage Collection and Finalizers......Page 166
Ask the Expert......Page 167
The this Keyword......Page 170
More Data Types and Operators......Page 174
One- Dimensional Arrays......Page 175
Progress Check......Page 179
Two- Dimensional Arrays......Page 181
Initializing Multidimensional Arrays......Page 184
Alternative Array Declaration Syntax......Page 186
Assigning Array References......Page 187
Using the length Member......Page 188
Progress Check......Page 190
Constructing Strings......Page 195
Operating on Strings......Page 196
Ask the Expert......Page 198
Strings Are Immutable......Page 199
Ask the Expert......Page 200
Progress Check......Page 202
The Bitwise AND, OR, XOR, and NOT Operators......Page 203
The Shift Operators......Page 208
Ask the Expert......Page 210
Progress Check......Page 213
A Closer Look at Methods and Classes......Page 218
Java’s Access Specifiers......Page 219
Progress Check......Page 224
Pass Objects to Methods......Page 226
How Arguments Are Passed......Page 228
Progress Check......Page 230
Returning Objects......Page 231
Method Overloading......Page 233
Ask the Expert......Page 238
Overloading Constructors......Page 239
Progress Check......Page 241
Recursion......Page 245
Understanding static......Page 247
Static Blocks......Page 250
Progress Check......Page 251
Introducing Nested and Inner Classes......Page 255
Ask the Expert......Page 258
Inheritance......Page 262
Inheritance Basics......Page 263
Member Access and Inheritance......Page 266
Constructors and Inheritance......Page 269
Using super to Call Superclass Constructors......Page 271
Progress Check......Page 276
Using super to Access Superclass Members......Page 277
Creating a Multilevel Hierarchy......Page 281
When Are Constructors Called?......Page 284
Subclass Objects......Page 285
Method Overriding......Page 291
Polymorphism......Page 294
Applying Method Overriding to TwoDShape......Page 296
Using Abstract Classes......Page 301
Progress Check......Page 305
final Prevents Inheritance......Page 306
Using final with Data Members......Page 307
Progress Check......Page 308
The Object Class......Page 309
Packages and Interfaces......Page 312
Defining a Package......Page 313
A Short Package Example......Page 315
Packages and Member Access......Page 317
A Package Access Example......Page 318
Importing Packages......Page 322
Ask the Expert......Page 323
Ask the Expert......Page 324
Progress Check......Page 325
Progress Check......Page 333
Ask the Expert......Page 340
Exception Handling......Page 344
Exception Handling Fundamentals......Page 345
Using try and catch......Page 346
A Simple Exception Example......Page 347
Progress Check......Page 349
Exceptions Enable You to Handle Errors Gracefully......Page 351
Progress Check......Page 352
Using Multiple catch Statements......Page 353
Try Blocks Can Be Nested......Page 355
Progress Check......Page 356
Rethrowing an Exception......Page 357
Ask the Expert......Page 358
A Closer Look at Throwable......Page 359
Using finally......Page 361
Using throws......Page 363
Java’s Built- in Exceptions......Page 365
Ask the Expert......Page 366
Creating Exception Subclasses......Page 367
Ask the Expert......Page 369
Step by Step......Page 370
Using I/ O......Page 376
Java’s I/ O Is Built upon Streams......Page 377
Progress Check......Page 380
Reading Console Input......Page 381
Writing Console Output......Page 383
Using Byte Streams......Page 384
Inputting from a File......Page 385
Ask the Expert......Page 386
Writing to a File......Page 387
Progress Check......Page 389
Progress Check......Page 393
Random Access Files......Page 395
Progress Check......Page 397
Console Input Using Character Streams......Page 399
Console Output Using Character Streams......Page 402
Progress Check......Page 403
Using a FileWriter......Page 404
Using a FileReader......Page 405
Ask the Expert......Page 406
to Convert Numeric Strings......Page 407
Ask the Expert......Page 409
Multithreaded Programming......Page 418
Multithreading Fundamentals......Page 419
Progress Check......Page 420
Creating a Thread......Page 421
Ask the Expert......Page 424
Progress Check......Page 426
Creating Multiple Threads......Page 429
Ask the Expert......Page 430
Thread Priorities......Page 435
Ask the Expert......Page 438
Synchronization......Page 439
notify( ), wait( ), and notifyAll( )......Page 445
An Example That Uses wait( ) and notify( )......Page 446
Ask the Expert......Page 450
and Stopping Threads......Page 451
Ask the Expert......Page 455
Applets, Events, and Miscellaneous Topics......Page 458
Applet Basics......Page 459
Progress Check......Page 462
Applet Organization and Essential Elements......Page 463
Requesting Repainting......Page 466
Ask the Expert......Page 467
Passing Parameters to Applets......Page 473
Progress Check......Page 474
The Applet Class......Page 475
Events......Page 477
Event Classes......Page 478
Event Listener Interfaces......Page 479
Progress Check......Page 480
Handling Mouse Events......Page 481
A Simple Mouse Event Applet......Page 482
The transient and volatile Modifiers......Page 485
assert......Page 486
What Next?......Page 488
Answers to Mastery Checks......Page 490
Using Java’s Documentation Comments......Page 526
The javadoc Tags......Page 527
{@ docRoot}......Page 528
@param......Page 529
@serialData......Page 530
@version......Page 531
Documentation Comments......Page 532
Index......Page 534
Contents at a Glance......Page 8
Contents......Page 10
Preface......Page 20
Java Fundamentals......Page 24
The Origins of Java......Page 25
How Java Relates to C and C++......Page 26
Progress Check......Page 27
Security......Page 28
Java’s Magic: The Bytecode......Page 29
The Java Buzzwords......Page 30
Object- Oriented Programming......Page 31
Encapsulation......Page 32
Inheritance......Page 33
Ask the Expert......Page 34
A First Simple Program......Page 35
Compiling the Program......Page 36
The First Sample Program Line by Line......Page 37
Progress Check......Page 39
A Second Simple Program......Page 40
Another Data Type......Page 43
Ask the Expert......Page 44
The if Statement......Page 46
The for Loop......Page 48
Create Blocks of Code......Page 50
Ask the Expert......Page 51
Indentation Practices......Page 52
Progress Check......Page 53
Identifiers in Java......Page 55
The Java Class Libraries......Page 56
Introducing Data Types and Operators......Page 58
Java’s Simple Types......Page 59
Integers......Page 60
Floating- Point Types......Page 61
Ask the Expert......Page 62
Characters......Page 63
The Boolean Type......Page 64
Progress Check......Page 65
Hexadecimal and Octal Constants......Page 67
String Literals......Page 68
Progress Check......Page 69
Initializing a Variable......Page 70
Dynamic Initialization......Page 71
Arithmetic Operators......Page 75
Increment and Decrement......Page 77
Relational and Logical Operators......Page 78
Short- Circuit Logical Operators......Page 80
The Assignment Operator......Page 81
Ask the Expert......Page 82
Casting Incompatible Types......Page 85
Operator Precedence......Page 87
Type Conversion in Expressions......Page 89
Spacing and Parentheses......Page 91
Program Control Statements......Page 94
Input Characters from the Keyboard......Page 95
Progress Check......Page 96
The if Statement......Page 97
Nested ifs......Page 98
The if- else- if Ladder......Page 99
The switch Statement......Page 101
Progress Check......Page 105
Ask the Expert......Page 108
The for Loop......Page 109
Some Variations on the for Loop......Page 110
Missing Pieces......Page 111
Loops with No Body......Page 113
Declaring Loop Control Variables Inside the for Loop......Page 114
The while Loop......Page 115
The do- while Loop......Page 117
Progress Check......Page 119
Use break to Exit a Loop......Page 123
Use break as a Form of goto......Page 125
Use continue......Page 129
Progress Check......Page 131
Nested Loops......Page 135
Introducing Classes, Objects, and Methods......Page 138
The General Form of a Class......Page 139
Defining a Class......Page 140
Progress Check......Page 143
Reference Variables and Assignment......Page 144
Methods......Page 145
Adding a Method to the Vehicle Class......Page 146
Adding a Parameterized Method to Vehicle......Page 153
Progress Check......Page 155
Adding a Constructor to the Vehicle Class......Page 164
The new Operator Revisited......Page 165
Garbage Collection and Finalizers......Page 166
Ask the Expert......Page 167
The this Keyword......Page 170
More Data Types and Operators......Page 174
One- Dimensional Arrays......Page 175
Progress Check......Page 179
Two- Dimensional Arrays......Page 181
Initializing Multidimensional Arrays......Page 184
Alternative Array Declaration Syntax......Page 186
Assigning Array References......Page 187
Using the length Member......Page 188
Progress Check......Page 190
Constructing Strings......Page 195
Operating on Strings......Page 196
Ask the Expert......Page 198
Strings Are Immutable......Page 199
Ask the Expert......Page 200
Progress Check......Page 202
The Bitwise AND, OR, XOR, and NOT Operators......Page 203
The Shift Operators......Page 208
Ask the Expert......Page 210
Progress Check......Page 213
A Closer Look at Methods and Classes......Page 218
Java’s Access Specifiers......Page 219
Progress Check......Page 224
Pass Objects to Methods......Page 226
How Arguments Are Passed......Page 228
Progress Check......Page 230
Returning Objects......Page 231
Method Overloading......Page 233
Ask the Expert......Page 238
Overloading Constructors......Page 239
Progress Check......Page 241
Recursion......Page 245
Understanding static......Page 247
Static Blocks......Page 250
Progress Check......Page 251
Introducing Nested and Inner Classes......Page 255
Ask the Expert......Page 258
Inheritance......Page 262
Inheritance Basics......Page 263
Member Access and Inheritance......Page 266
Constructors and Inheritance......Page 269
Using super to Call Superclass Constructors......Page 271
Progress Check......Page 276
Using super to Access Superclass Members......Page 277
Creating a Multilevel Hierarchy......Page 281
When Are Constructors Called?......Page 284
Subclass Objects......Page 285
Method Overriding......Page 291
Polymorphism......Page 294
Applying Method Overriding to TwoDShape......Page 296
Using Abstract Classes......Page 301
Progress Check......Page 305
final Prevents Inheritance......Page 306
Using final with Data Members......Page 307
Progress Check......Page 308
The Object Class......Page 309
Packages and Interfaces......Page 312
Defining a Package......Page 313
A Short Package Example......Page 315
Packages and Member Access......Page 317
A Package Access Example......Page 318
Importing Packages......Page 322
Ask the Expert......Page 323
Ask the Expert......Page 324
Progress Check......Page 325
Progress Check......Page 333
Ask the Expert......Page 340
Exception Handling......Page 344
Exception Handling Fundamentals......Page 345
Using try and catch......Page 346
A Simple Exception Example......Page 347
Progress Check......Page 349
Exceptions Enable You to Handle Errors Gracefully......Page 351
Progress Check......Page 352
Using Multiple catch Statements......Page 353
Try Blocks Can Be Nested......Page 355
Progress Check......Page 356
Rethrowing an Exception......Page 357
Ask the Expert......Page 358
A Closer Look at Throwable......Page 359
Using finally......Page 361
Using throws......Page 363
Java’s Built- in Exceptions......Page 365
Ask the Expert......Page 366
Creating Exception Subclasses......Page 367
Ask the Expert......Page 369
Step by Step......Page 370
Using I/ O......Page 376
Java’s I/ O Is Built upon Streams......Page 377
Progress Check......Page 380
Reading Console Input......Page 381
Writing Console Output......Page 383
Using Byte Streams......Page 384
Inputting from a File......Page 385
Ask the Expert......Page 386
Writing to a File......Page 387
Progress Check......Page 389
Progress Check......Page 393
Random Access Files......Page 395
Progress Check......Page 397
Console Input Using Character Streams......Page 399
Console Output Using Character Streams......Page 402
Progress Check......Page 403
Using a FileWriter......Page 404
Using a FileReader......Page 405
Ask the Expert......Page 406
to Convert Numeric Strings......Page 407
Ask the Expert......Page 409
Multithreaded Programming......Page 418
Multithreading Fundamentals......Page 419
Progress Check......Page 420
Creating a Thread......Page 421
Ask the Expert......Page 424
Progress Check......Page 426
Creating Multiple Threads......Page 429
Ask the Expert......Page 430
Thread Priorities......Page 435
Ask the Expert......Page 438
Synchronization......Page 439
notify( ), wait( ), and notifyAll( )......Page 445
An Example That Uses wait( ) and notify( )......Page 446
Ask the Expert......Page 450
and Stopping Threads......Page 451
Ask the Expert......Page 455
Applets, Events, and Miscellaneous Topics......Page 458
Applet Basics......Page 459
Progress Check......Page 462
Applet Organization and Essential Elements......Page 463
Requesting Repainting......Page 466
Ask the Expert......Page 467
Passing Parameters to Applets......Page 473
Progress Check......Page 474
The Applet Class......Page 475
Events......Page 477
Event Classes......Page 478
Event Listener Interfaces......Page 479
Progress Check......Page 480
Handling Mouse Events......Page 481
A Simple Mouse Event Applet......Page 482
The transient and volatile Modifiers......Page 485
assert......Page 486
What Next?......Page 488
Answers to Mastery Checks......Page 490
Using Java’s Documentation Comments......Page 526
The javadoc Tags......Page 527
{@ docRoot}......Page 528
@param......Page 529
@serialData......Page 530
@version......Page 531
Documentation Comments......Page 532
Index......Page 534
备用描述
Cover 1
Contents at a Glance 8
Contents 10
Preface 20
Java Fundamentals 24
The Origins of Java 25
How Java Relates to C and C++ 26
How Java Relates to C# 27
Progress Check 27
Java Applets and Applications 28
Security 28
Portability 29
Java’s Magic: The Bytecode 29
The Java Buzzwords 30
Ask the Expert 31
Progress Check 31
Object- Oriented Programming 31
Encapsulation 32
Polymorphism 33
Inheritance 33
Progress Check 34
Ask the Expert 34
Obtaining the Java Software Developer’s Kit 35
A First Simple Program 35
Entering the Program 36
Compiling the Program 36
The First Sample Program Line by Line 37
Progress Check 39
Handling Syntax Errors 40
A Second Simple Program 40
Another Data Type 43
Ask the Expert 44
Progress Check 46
Two Control Statements 46
The if Statement 46
The for Loop 48
Progress Check 50
Create Blocks of Code 50
Ask the Expert 51
Indentation Practices 52
Progress Check 53
Identifiers in Java 55
Progress Check 56
The Java Class Libraries 56
Introducing Data Types and Operators 58
Why Data Types Are Important 59
Java’s Simple Types 59
Integers 60
Floating- Point Types 61
Ask the Expert 62
Characters 63
Ask the Expert 64
The Boolean Type 64
Progress Check 65
Literals 67
Hexadecimal and Octal Constants 67
Character Escape Sequences 68
String Literals 68
Progress Check 69
Ask the Expert 70
A Closer Look at Variables 70
Initializing a Variable 70
Dynamic Initialization 71
Progress Check 75
Operators 75
Arithmetic Operators 75
Increment and Decrement 77
Relational and Logical Operators 78
Short- Circuit Logical Operators 80
Progress Check 81
The Assignment Operator 81
Ask the Expert 82
Casting Incompatible Types 85
Progress Check 87
Operator Precedence 87
Expressions 89
Type Conversion in Expressions 89
Spacing and Parentheses 91
Program Control Statements 94
Input Characters from the Keyboard 95
Progress Check 96
The if Statement 97
Nested ifs 98
The if- else- if Ladder 99
Progress Check 101
The switch Statement 101
Nested switch Statements 105
Progress Check 105
Ask the Expert 108
The for Loop 109
Some Variations on the for Loop 110
Missing Pieces 111
Loops with No Body 113
Declaring Loop Control Variables Inside the for Loop 114
Progress Check 115
The while Loop 115
Ask the Expert 117
The do- while Loop 117
Progress Check 119
Use break to Exit a Loop 123
Use break as a Form of goto 125
Ask the Expert 129
Use continue 129
Progress Check 131
Nested Loops 135
Introducing Classes, Objects, and Methods 138
Class Fundamentals 139
The General Form of a Class 139
Defining a Class 140
Progress Check 143
Reference Variables and Assignment 144
Progress Check 145
Methods 145
Adding a Method to the Vehicle Class 146
Adding a Parameterized Method to Vehicle 153
Progress Check 155
Adding a Constructor to the Vehicle Class 164
Progress Check 165
The new Operator Revisited 165
Ask the Expert 166
Garbage Collection and Finalizers 166
The finalize( ) Method 167
Ask the Expert 167
The this Keyword 170
More Data Types and Operators 174
Arrays 175
One- Dimensional Arrays 175
Progress Check 179
Multidimensional Arrays 181
Two- Dimensional Arrays 181
Arrays of Three or More Dimensions 184
Initializing Multidimensional Arrays 184
Progress Check 186
Alternative Array Declaration Syntax 186
Assigning Array References 187
Using the length Member 188
Progress Check 190
Strings 195
Constructing Strings 195
Operating on Strings 196
Ask the Expert 198
Arrays of Strings 199
Strings Are Immutable 199
Ask the Expert 200
Progress Check 202
The Bitwise Operators 203
The Bitwise AND, OR, XOR, and NOT Operators 203
The Shift Operators 208
Bitwise Shorthand Assignments 210
Ask the Expert 210
Progress Check 213
A Closer Look at Methods and Classes 218
Controlling Access to Class Members 219
Java’s Access Specifiers 219
Progress Check 224
Pass Objects to Methods 226
How Arguments Are Passed 228
Ask the Expert 230
Progress Check 230
Returning Objects 231
Method Overloading 233
Ask the Expert 238
Progress Check 239
Overloading Constructors 239
Progress Check 241
Recursion 245
Understanding static 247
Static Blocks 250
Progress Check 251
Introducing Nested and Inner Classes 255
Ask the Expert 258
Inheritance 262
Inheritance Basics 263
Member Access and Inheritance 266
Ask the Expert 269
Progress Check 269
Constructors and Inheritance 269
Using super to Call Superclass Constructors 271
Progress Check 276
Using super to Access Superclass Members 277
Creating a Multilevel Hierarchy 281
When Are Constructors Called? 284
Superclass References and 285
Subclass Objects 285
Progress Check 291
Method Overriding 291
Overridden Methods Support 294
Polymorphism 294
Ask the Expert 296
Why Overridden Methods? 296
Applying Method Overriding to TwoDShape 296
Progress Check 301
Using Abstract Classes 301
Progress Check 305
final Prevents Overriding 306
final Prevents Inheritance 306
Using final with Data Members 307
Ask the Expert 308
Progress Check 308
The Object Class 309
Packages and Interfaces 312
Packages 313
Defining a Package 313
Finding Packages and CLASSPATH 315
A Short Package Example 315
Progress Check 317
Packages and Member Access 317
Progress Check 318
A Package Access Example 318
Importing Packages 322
Ask the Expert 323
Ask the Expert 324
Java’s Class Library 325
Is Contained in Packages 325
Progress Check 325
Progress Check 333
Ask the Expert 340
Exception Handling 344
The Exception Hierarchy 345
Exception Handling Fundamentals 345
Ask the Expert 346
Using try and catch 346
A Simple Exception Example 347
Progress Check 349
Exceptions Enable You to Handle Errors Gracefully 351
Progress Check 352
Using Multiple catch Statements 353
Ask the Expert 355
Try Blocks Can Be Nested 355
Progress Check 356
Throwing an Exception 357
Rethrowing an Exception 357
Ask the Expert 358
Progress Check 359
A Closer Look at Throwable 359
Using finally 361
Progress Check 363
Using throws 363
Java’s Built- in Exceptions 365
Ask the Expert 366
Progress Check 367
Creating Exception Subclasses 367
Ask the Expert 369
Step by Step 370
Using I/ O 376
Java’s I/ O Is Built upon Streams 377
Progress Check 380
Using the Byte Streams 381
Reading Console Input 381
Writing Console Output 383
Progress Check 384
Reading and Writing Files 384
Using Byte Streams 384
Inputting from a File 385
Ask the Expert 386
Writing to a File 387
Progress Check 389
Progress Check 393
Random Access Files 395
Progress Check 397
Console Input Using Character Streams 399
Console Output Using Character Streams 402
Progress Check 403
Using a FileWriter 404
Using a FileReader 405
Ask the Expert 406
Progress Check 407
Using Java’s Type Wrappers 407
to Convert Numeric Strings 407
Ask the Expert 409
Multithreaded Programming 418
Multithreading Fundamentals 419
Progress Check 420
Creating a Thread 421
Some Simple Improvements 424
Ask the Expert 424
Progress Check 426
Creating Multiple Threads 429
Ask the Expert 430
Progress Check 435
Thread Priorities 435
Ask the Expert 438
Synchronization 439
Progress Check 445
Thread Communication Using 445
notify( ), wait( ), and notifyAll( ) 445
An Example That Uses wait( ) and notify( ) 446
Progress Check 450
Ask the Expert 450
Suspending, Resuming, 451
and Stopping Threads 451
Ask the Expert 455
Applets, Events, and Miscellaneous Topics 458
Applet Basics 459
Progress Check 462
Applet Organization and Essential Elements 463
Progress Check 466
Requesting Repainting 466
The update( ) Method 467
Ask the Expert 467
Passing Parameters to Applets 473
Progress Check 474
The Applet Class 475
Event Handling 477
The Delegation Event Model 477
Events 477
Event Sources 478
Event Listeners 478
Event Classes 478
Event Listener Interfaces 479
Progress Check 480
Using the Delegation Event Model 481
Handling Mouse Events 481
A Simple Mouse Event Applet 482
More Java Keywords 485
The transient and volatile Modifiers 485
instanceof 486
strictfp 486
assert 486
Native Methods 488
What Next? 488
Answers to Mastery Checks 490
Using Java’s Documentation Comments 526
The javadoc Tags 527
@author 528
@deprecated 528
{@ docRoot} 528
@exception 529
{@ inheritDoc} 529
{@ link} 529
{@ linkplain} 529
@param 529
@return 530
@see 530
@serial 530
@serialData 530
@serialField 531
@since 531
@throws 531
{@ value} 531
@version 531
The General Form of a 532
Documentation Comment 532
What javadoc Outputs 532
An Example that Uses 532
Documentation Comments 532
Index 534
Contents at a Glance 8
Contents 10
Preface 20
Java Fundamentals 24
The Origins of Java 25
How Java Relates to C and C++ 26
How Java Relates to C# 27
Progress Check 27
Java Applets and Applications 28
Security 28
Portability 29
Java’s Magic: The Bytecode 29
The Java Buzzwords 30
Ask the Expert 31
Progress Check 31
Object- Oriented Programming 31
Encapsulation 32
Polymorphism 33
Inheritance 33
Progress Check 34
Ask the Expert 34
Obtaining the Java Software Developer’s Kit 35
A First Simple Program 35
Entering the Program 36
Compiling the Program 36
The First Sample Program Line by Line 37
Progress Check 39
Handling Syntax Errors 40
A Second Simple Program 40
Another Data Type 43
Ask the Expert 44
Progress Check 46
Two Control Statements 46
The if Statement 46
The for Loop 48
Progress Check 50
Create Blocks of Code 50
Ask the Expert 51
Indentation Practices 52
Progress Check 53
Identifiers in Java 55
Progress Check 56
The Java Class Libraries 56
Introducing Data Types and Operators 58
Why Data Types Are Important 59
Java’s Simple Types 59
Integers 60
Floating- Point Types 61
Ask the Expert 62
Characters 63
Ask the Expert 64
The Boolean Type 64
Progress Check 65
Literals 67
Hexadecimal and Octal Constants 67
Character Escape Sequences 68
String Literals 68
Progress Check 69
Ask the Expert 70
A Closer Look at Variables 70
Initializing a Variable 70
Dynamic Initialization 71
Progress Check 75
Operators 75
Arithmetic Operators 75
Increment and Decrement 77
Relational and Logical Operators 78
Short- Circuit Logical Operators 80
Progress Check 81
The Assignment Operator 81
Ask the Expert 82
Casting Incompatible Types 85
Progress Check 87
Operator Precedence 87
Expressions 89
Type Conversion in Expressions 89
Spacing and Parentheses 91
Program Control Statements 94
Input Characters from the Keyboard 95
Progress Check 96
The if Statement 97
Nested ifs 98
The if- else- if Ladder 99
Progress Check 101
The switch Statement 101
Nested switch Statements 105
Progress Check 105
Ask the Expert 108
The for Loop 109
Some Variations on the for Loop 110
Missing Pieces 111
Loops with No Body 113
Declaring Loop Control Variables Inside the for Loop 114
Progress Check 115
The while Loop 115
Ask the Expert 117
The do- while Loop 117
Progress Check 119
Use break to Exit a Loop 123
Use break as a Form of goto 125
Ask the Expert 129
Use continue 129
Progress Check 131
Nested Loops 135
Introducing Classes, Objects, and Methods 138
Class Fundamentals 139
The General Form of a Class 139
Defining a Class 140
Progress Check 143
Reference Variables and Assignment 144
Progress Check 145
Methods 145
Adding a Method to the Vehicle Class 146
Adding a Parameterized Method to Vehicle 153
Progress Check 155
Adding a Constructor to the Vehicle Class 164
Progress Check 165
The new Operator Revisited 165
Ask the Expert 166
Garbage Collection and Finalizers 166
The finalize( ) Method 167
Ask the Expert 167
The this Keyword 170
More Data Types and Operators 174
Arrays 175
One- Dimensional Arrays 175
Progress Check 179
Multidimensional Arrays 181
Two- Dimensional Arrays 181
Arrays of Three or More Dimensions 184
Initializing Multidimensional Arrays 184
Progress Check 186
Alternative Array Declaration Syntax 186
Assigning Array References 187
Using the length Member 188
Progress Check 190
Strings 195
Constructing Strings 195
Operating on Strings 196
Ask the Expert 198
Arrays of Strings 199
Strings Are Immutable 199
Ask the Expert 200
Progress Check 202
The Bitwise Operators 203
The Bitwise AND, OR, XOR, and NOT Operators 203
The Shift Operators 208
Bitwise Shorthand Assignments 210
Ask the Expert 210
Progress Check 213
A Closer Look at Methods and Classes 218
Controlling Access to Class Members 219
Java’s Access Specifiers 219
Progress Check 224
Pass Objects to Methods 226
How Arguments Are Passed 228
Ask the Expert 230
Progress Check 230
Returning Objects 231
Method Overloading 233
Ask the Expert 238
Progress Check 239
Overloading Constructors 239
Progress Check 241
Recursion 245
Understanding static 247
Static Blocks 250
Progress Check 251
Introducing Nested and Inner Classes 255
Ask the Expert 258
Inheritance 262
Inheritance Basics 263
Member Access and Inheritance 266
Ask the Expert 269
Progress Check 269
Constructors and Inheritance 269
Using super to Call Superclass Constructors 271
Progress Check 276
Using super to Access Superclass Members 277
Creating a Multilevel Hierarchy 281
When Are Constructors Called? 284
Superclass References and 285
Subclass Objects 285
Progress Check 291
Method Overriding 291
Overridden Methods Support 294
Polymorphism 294
Ask the Expert 296
Why Overridden Methods? 296
Applying Method Overriding to TwoDShape 296
Progress Check 301
Using Abstract Classes 301
Progress Check 305
final Prevents Overriding 306
final Prevents Inheritance 306
Using final with Data Members 307
Ask the Expert 308
Progress Check 308
The Object Class 309
Packages and Interfaces 312
Packages 313
Defining a Package 313
Finding Packages and CLASSPATH 315
A Short Package Example 315
Progress Check 317
Packages and Member Access 317
Progress Check 318
A Package Access Example 318
Importing Packages 322
Ask the Expert 323
Ask the Expert 324
Java’s Class Library 325
Is Contained in Packages 325
Progress Check 325
Progress Check 333
Ask the Expert 340
Exception Handling 344
The Exception Hierarchy 345
Exception Handling Fundamentals 345
Ask the Expert 346
Using try and catch 346
A Simple Exception Example 347
Progress Check 349
Exceptions Enable You to Handle Errors Gracefully 351
Progress Check 352
Using Multiple catch Statements 353
Ask the Expert 355
Try Blocks Can Be Nested 355
Progress Check 356
Throwing an Exception 357
Rethrowing an Exception 357
Ask the Expert 358
Progress Check 359
A Closer Look at Throwable 359
Using finally 361
Progress Check 363
Using throws 363
Java’s Built- in Exceptions 365
Ask the Expert 366
Progress Check 367
Creating Exception Subclasses 367
Ask the Expert 369
Step by Step 370
Using I/ O 376
Java’s I/ O Is Built upon Streams 377
Progress Check 380
Using the Byte Streams 381
Reading Console Input 381
Writing Console Output 383
Progress Check 384
Reading and Writing Files 384
Using Byte Streams 384
Inputting from a File 385
Ask the Expert 386
Writing to a File 387
Progress Check 389
Progress Check 393
Random Access Files 395
Progress Check 397
Console Input Using Character Streams 399
Console Output Using Character Streams 402
Progress Check 403
Using a FileWriter 404
Using a FileReader 405
Ask the Expert 406
Progress Check 407
Using Java’s Type Wrappers 407
to Convert Numeric Strings 407
Ask the Expert 409
Multithreaded Programming 418
Multithreading Fundamentals 419
Progress Check 420
Creating a Thread 421
Some Simple Improvements 424
Ask the Expert 424
Progress Check 426
Creating Multiple Threads 429
Ask the Expert 430
Progress Check 435
Thread Priorities 435
Ask the Expert 438
Synchronization 439
Progress Check 445
Thread Communication Using 445
notify( ), wait( ), and notifyAll( ) 445
An Example That Uses wait( ) and notify( ) 446
Progress Check 450
Ask the Expert 450
Suspending, Resuming, 451
and Stopping Threads 451
Ask the Expert 455
Applets, Events, and Miscellaneous Topics 458
Applet Basics 459
Progress Check 462
Applet Organization and Essential Elements 463
Progress Check 466
Requesting Repainting 466
The update( ) Method 467
Ask the Expert 467
Passing Parameters to Applets 473
Progress Check 474
The Applet Class 475
Event Handling 477
The Delegation Event Model 477
Events 477
Event Sources 478
Event Listeners 478
Event Classes 478
Event Listener Interfaces 479
Progress Check 480
Using the Delegation Event Model 481
Handling Mouse Events 481
A Simple Mouse Event Applet 482
More Java Keywords 485
The transient and volatile Modifiers 485
instanceof 486
strictfp 486
assert 486
Native Methods 488
What Next? 488
Answers to Mastery Checks 490
Using Java’s Documentation Comments 526
The javadoc Tags 527
@author 528
@deprecated 528
{@ docRoot} 528
@exception 529
{@ inheritDoc} 529
{@ link} 529
{@ linkplain} 529
@param 529
@return 530
@see 530
@serial 530
@serialData 530
@serialField 531
@since 531
@throws 531
{@ value} 531
@version 531
The General Form of a 532
Documentation Comment 532
What javadoc Outputs 532
An Example that Uses 532
Documentation Comments 532
Index 534
备用描述
The Most Comprehensive and Definitive Guide to Java!Let Herb Schildt, the world's leading programming author, show you everything you need to develop, compile, debug, and run Java applications and applets. This definitive guide contains complete details on the Java language, its class libraries, and its development environment along with hundreds of examples and expert techniques. Fully updated to cover the latest features of Java 2, v1.4, including the new I/O API, regular expressions, chained exceptions, the assert keyword, and upgrades to Java’s networking classes and the Collections Framework, this comprehensive reference is a must-have for every Java programmer. And, everything is explained in the clear, uncompromising style that has made Herb Schildt the choice of millions worldwide.Master the entire Java language and its core libraries Build portable applets and applications Fully utilize the Abstract Windows Toolkit (AWT) Use layout managers effectively Supercharge your programs using multithreading Leverage the power of the Collections Framework Apply Java’s networking and imaging classes Migrate code from C++ to Java Explore servlets, Swing, and JavaBeans Learn about Java’s newest features—including the new I/O and regular expression APIs, the assert keyword, and chained exceptions
备用描述
Essential Skills for First-Time Programmers! This Beginner's Guide is Designed for Easy Learning: Modules: Each programming concept is divided into logical modules (chapters), ideal for linear learning Goals: Each module opens with the specific programming skills you'll have by the end of the module Ask the Experts: Q&A sections throughout 1-Minute Drills: Quick self-assessment sections to check your progress Annotated Syntax: Example code annotated with commentary that points to the particular technique illustrated Projects: Coding exercises contained in each module that build on one another, from simple to complex Mastery Checks: End-of-module reviews that test proficiency using multiple-choice, fill-in-the-blank, and simple coding questions
备用描述
An updated introduction to the latest version of Java 2 JDK utilizes a sereis of modules, complete with detailed explanations, hands-on exercises, and several projects designed to reinforce proficiency in a variety of concepts, covering such topics as Java fundamentals, program control statements, data types and operators, multithreaded programming, and more. Original. (Beginner)
备用描述
Bestselling author and programming guru Herb Schildt brings you Java 2 essentials in this newly updated introductory guide. Covering the latest I/O classes and features, this book teaches you Java 2 fundamentals through hands-on projects, end-of-module reviews, annotated code samples, and Q & A sections
开源日期
2009-07-20
🚀 快速下载
成为会员以支持书籍、论文等的长期保存。为了感谢您对我们的支持,您将获得高速下载权益。❤️
🐢 低速下载
由可信的合作方提供。 更多信息请参见常见问题解答。 (可能需要验证浏览器——无限次下载!)
- 低速服务器(合作方提供) #1 (稍快但需要排队)
- 低速服务器(合作方提供) #2 (稍快但需要排队)
- 低速服务器(合作方提供) #3 (稍快但需要排队)
- 低速服务器(合作方提供) #4 (稍快但需要排队)
- 低速服务器(合作方提供) #5 (无需排队,但可能非常慢)
- 低速服务器(合作方提供) #6 (无需排队,但可能非常慢)
- 低速服务器(合作方提供) #7 (无需排队,但可能非常慢)
- 低速服务器(合作方提供) #8 (无需排队,但可能非常慢)
- 低速服务器(合作方提供) #9 (无需排队,但可能非常慢)
- 下载后: 在我们的查看器中打开
所有选项下载的文件都相同,应该可以安全使用。即使这样,从互联网下载文件时始终要小心。例如,确保您的设备更新及时。
外部下载
-
对于大文件,我们建议使用下载管理器以防止中断。
推荐的下载管理器:JDownloader -
您将需要一个电子书或 PDF 阅读器来打开文件,具体取决于文件格式。
推荐的电子书阅读器:Anna的档案在线查看器、ReadEra和Calibre -
使用在线工具进行格式转换。
推荐的转换工具:CloudConvert和PrintFriendly -
您可以将 PDF 和 EPUB 文件发送到您的 Kindle 或 Kobo 电子阅读器。
推荐的工具:亚马逊的“发送到 Kindle”和djazz 的“发送到 Kobo/Kindle” -
支持作者和图书馆
✍️ 如果您喜欢这个并且能够负担得起,请考虑购买原版,或直接支持作者。
📚 如果您当地的图书馆有这本书,请考虑在那里免费借阅。
下面的文字仅以英文继续。
总下载量:
“文件的MD5”是根据文件内容计算出的哈希值,并且基于该内容具有相当的唯一性。我们这里索引的所有影子图书馆都主要使用MD5来标识文件。
一个文件可能会出现在多个影子图书馆中。有关我们编译的各种数据集的信息,请参见数据集页面。
有关此文件的详细信息,请查看其JSON 文件。 Live/debug JSON version. Live/debug page.