The Java Tutorial: A Short Course on the Basics

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Author(s): Sharon Biocca Zakhour, Joni Gordon, Sowmya Kannan, Scott Hommel, Raymond Gallardo
Edition: 6th
Publisher: Addison-Wesley Professional
Year: 2014

Language: English
Pages: 1311
Tags: Java, Programming

Contents......Page 2
Preface......Page 9
Who Should Read This Book?......Page 11
How to Use This Book......Page 12
Acknowledgements......Page 14
About the Authors......Page 15
The Java Technology Phenomenon......Page 17
What Can Java Technology Do?......Page 20
How Will Java Technology Change My Life?......Page 21
The “Hello World!” Application......Page 22
“Hello World!” for the NetBeans IDE......Page 23
“Hello World!” for Microsoft Windows......Page 37
“Hello World!” for Solaris OS and Linux......Page 44
A Closer Look at the “Hello World!” Application......Page 51
Common Problems (and Their Solutions)......Page 56
Questions and Exercises: Getting Started......Page 63
Chapter 1 Notes......Page 64
Chapter 2. Object-Oriented Programming Concepts......Page 66
What Is an Object?......Page 67
What Is a Class?......Page 70
What Is Inheritance?......Page 73
What Is an Interface?......Page 75
What Is a Package?......Page 78
Questions and Exercises: Object-Oriented Programming Concepts......Page 79
Variables......Page 81
Operators......Page 106
Expressions, Statements, and Blocks......Page 124
Control Flow Statements......Page 129
Chapter 3 Notes......Page 159
Classes......Page 161
Objects......Page 183
More on Classes......Page 196
Nested Classes......Page 221
Enum Types......Page 286
Chapter 4 Notes......Page 294
Annotations Basics......Page 296
Declaring an Annotation Type......Page 299
Predefined Annotation Types......Page 302
Type Annotations and Pluggable Type Systems......Page 306
Repeating Annotations......Page 308
Questions and Exercises: Annotations......Page 311
Chapter 5 Notes......Page 312
Interfaces......Page 314
Inheritance......Page 349
Chapter 6 Notes......Page 389
Why Use Generics?......Page 392
Generic Types......Page 393
Generic Methods......Page 402
Bounded Type Parameters......Page 405
Generics, Inheritance, and Subtypes......Page 410
Type Inference......Page 413
Wildcards......Page 420
Type Erasure......Page 436
Restrictions on Generics......Page 451
Questions and Exercises: Generics......Page 458
Chapter 7 Notes......Page 461
Creating and Using Packages......Page 462
Questions and Exercises: Creating and Using Packages......Page 479
Numbers......Page 481
Characters......Page 507
Strings......Page 510
Chapter 9 Notes......Page 540
What Is an Exception?......Page 542
The Catch or Specify Requirement......Page 544
Catching and Handling Exceptions......Page 546
Specifying the Exceptions Thrown by a Method......Page 567
How to Throw Exceptions......Page 568
Unchecked Exceptions—The Controversy......Page 577
Advantages of Exceptions......Page 578
Summary......Page 588
Questions and Exercises: Exceptions......Page 589
Chapter 10 Notes......Page 591
I/O Streams......Page 592
File I/O (Featuring NIO.2)......Page 625
Summary......Page 722
Questions and Exercises: Basic I/O......Page 723
Chapter 11 Notes......Page 724
Chapter 12. Collections......Page 738
Introduction to Collections......Page 739
Interfaces......Page 741
Aggregate Operations......Page 818
Implementations......Page 848
Algorithms......Page 869
Custom Collection Implementations......Page 876
Interoperability......Page 882
Chapter 12 Notes......Page 888
Processes and Threads......Page 898
Thread Objects......Page 900
Synchronization......Page 911
Liveness......Page 922
Guarded Blocks......Page 926
Immutable Objects......Page 934
High Level Concurrency Objects......Page 941
Questions and Exercises: Concurrency......Page 961
Chapter 13 Notes......Page 962
Chapter 14. Regular Expressions......Page 965
Introduction......Page 966
Test Harness......Page 967
String Literals......Page 969
Character Classes......Page 972
Predefined Character Classes......Page 981
Quantifiers......Page 985
Capturing Groups......Page 996
Boundary Matchers......Page 999
Methods of the Pattern Class......Page 1002
Methods of the Matcher Class......Page 1011
Methods of the PatternSyntaxException Class......Page 1021
Unicode Support......Page 1025
Additional Resources......Page 1026
Questions and Exercises: Regular Expressions......Page 1027
Chapter 14 Notes......Page 1028
Configuration Utilities......Page 1031
System Utilities......Page 1043
PATH and CLASSPATH......Page 1052
Questions and Exercises: The Platform Environment......Page 1059
Chapter 15 Notes......Page 1060
Chapter 16. Packaging Programs in JAR Files......Page 1062
Using JAR Files: The Basics......Page 1063
Working with Manifest Files: The Basics......Page 1081
Signing and Verifying JAR Files......Page 1095
Using JAR-Related APIs......Page 1104
Chapter 16 Notes......Page 1114
Chapter 17. Java Web Start......Page 1117
Developing a Java Web Start Application......Page 1118
Deploying a Java Web Start Application......Page 1123
Displaying a Customized Loading Progress Indicator......Page 1128
Running a Java Web Start Application......Page 1136
Java Web Start and Security......Page 1137
Common Java Web Start Problems......Page 1139
Questions and Exercises: Java Web Start......Page 1140
Chapter 17 Notes......Page 1141
Getting Started with Applets......Page 1143
Doing More with Applets......Page 1163
Solving Common Applet Problems......Page 1219
Questions and Exercises: Applets......Page 1221
Chapter 18 Notes......Page 1222
Setting Trusted Arguments and Secure Properties......Page 1226
JNLP API......Page 1231
Cookies......Page 1240
Customizing the Loading Experience......Page 1244
Security in Rich Internet Applications......Page 1245
Guidelines for Securing Rich Internet Applications......Page 1247
Questions and Exercises: Doing More with Rich Internet Applications......Page 1250
Chapter 19 Notes......Page 1251
User Acceptance of RIAs......Page 1254
Deployment Toolkit......Page 1256
Java Network Launch Protocol......Page 1269
Deployment Best Practices......Page 1282
Questions and Exercises: Deployment In Depth......Page 1290
Chapter 20 Notes......Page 1291
Chapter 21. Introduction to JavaFX......Page 1292
Programmer Level I Exam......Page 1294
Java SE 8 Upgrade Exam......Page 1300
Appendix. Notes......Page 1305