Java 2: A Beginner’s Guide

Free Download

Authors:

Edition: 2nd

ISBN: 0072225882, 9780072225884, 9780072230413

Size: 3 MB (2638901 bytes)

Pages: 545/545

File format:

Language:

Publishing Year:

Category:

Herbert Schildt0072225882, 9780072225884, 9780072230413

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

Table of contents :
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

Reviews

There are no reviews yet.

Be the first to review “Java 2: A Beginner’s Guide”
Shopping Cart
Scroll to Top