Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword or section
Like this
3Activity

Table Of Contents

Overview
What’s Inside
How the Recipes Are Organized
A Few Words of Caution
Java Experience Required
What Version of Java?
Working with Strings and Regular Expressions
An Overview of Java’s String Classes
Java’s Regular Expression API
An Introduction to Regular Expressions
Normal Characters
Character Classes
The Wildcard Character
Greedy, Reluctant, and Possessive Quantifiers
Boundary Matchers
The OR Operator
Groups
Flag Sequences
Remember to Escape the \ in Java Strings
Sort an Array of Strings in Reverse Order
Step-by-Step
Discussion
Example
Options and Alternatives
Ignore Case Differences when Sorting an Array of Strings
Ignore Case Differences when Searching for or Replacing Substrings
Split a String into Pieces by Using split( )
Retrieve Key/Value Pairs from a String
Match and Extract Substrings Using the Regular Expression API
Tokenize a String Using the Regular Expression API
Bonus Example
File Handling
An Overview of File Handling
Streams
The RandomAccessFile Class
The File Class
The I/O Interfaces
The Compressed File Streams
Tips for Handling Errors
Read Bytes from a File
Write Bytes to a File
Buffer Byte-Based File I/O
Read Characters from a File
Write Characters to a File
Buffer Character-Based File I/O
Read and Write Random-Access Files
Obtain File Attributes
Set File Attributes
List a Directory
Compress and Decompress Data
Create a ZIP File
Serialize Objects
Formatting Data
An Overview of Formatter
Formatting Basics
Specifying a Minimum Field Width
Specifying Precision
Using the Format Flags
The Uppercase Option
Using an Argument Index
Overview of NumberFormat and DateFormat
Four Simple Numeric Formatting Techniques Using Formatter
Vertically Align Numeric Data Using Formatter
Bonus Example: Center Data
Left-Justify Output Using Formatter
Format Time and Date Using Formatter
Specify a Locale with Formatter
Use Streams with Formatter
Use printf( ) to Display Formatted Data
Format Time and Date with DateFormat
Format Time and Date with Patterns Using SimpleDateFormat
Format Numeric Values with NumberFormat
Format Currency Values Using NumberFormat
Format Numeric Values with Patterns Using DecimalFormat
Working with Collections
Collections Overview
Three Recent Changes
The Collection Interfaces
The Collection Interface
The Collection Classes
The ArrayList Class
The LinkedList Class
The HashSet Class
The LinkedHashSet Class
The TreeSet Class
The PriorityQueue Class
The ArrayDeque Class
The EnumSet Class
An Overview of Maps
The Map Interfaces
The Map Classes
Algorithms
Basic Collection Techniques
Work with Lists
Work with Sets
Use Comparable to Store Objects in a Sorted Collection
Use a Comparator with a Collection
Iterate a Collection
Create a Queue or a Stack Using Deque
Reverse, Rotate, and Shuffle a List
Sort and Search a List
Create a Checked Collection
Create a Synchronized Collection
Create an Immutable Collection
Basic Map Techniques
Convert a Properties List into a HashMap
Applets and Servlets
Applet Overview
The Applet Class
Applet Architecture
The Applet Life Cycle
The AppletContext, AudioClip, and AppletStub Interfaces
Servlet Overview
The javax.servlet Package
The javax.servlet.http Package
The HttpServlet Class
The Cookie Class
The Servlet Life Cycle
Using Tomcat for Servlet Development
Create an AWT-Based Applet Skeleton
Create a Swing-Based Applet Skeleton
Create a GUI and Handle Events in a Swing Applet
Historical Note: getContentPane( )
Paint Directly to the Surface of an Applet
Pass Parameters to Applets
Use AppletContext to Display a Web Page
Create a Simple Servlet Using GenericServlet
Handle HTTP Requests in a Servlet
Use a Cookie with a Servlet
Create a Thread by Implementing Runnable
Create a Thread by Extending Thread
Use a Thread’s Name and ID
Wait for a Thread to End
Synchronize Threads
Communicate Between Threads
Suspend, Resume, and Stop a Thread
Use a Daemon Thread
Bonus Example: A Simple Reminder Class
Interrupt a Thread
Set and Obtain a Thread’s Priority
Monitor a Thread’s State
Bonus Example: A Real-Time Thread Monitor
Use a Thread Group
Overview of Swing
Components and Containers
Components
Containers
The Top-Level Container Panes
Layout Manager Overview
Event Handling
Events
Event Sources
Event Listeners
Create a Simple Swing Application
Create a Simple Push Button
Use Icons, HTML, and Mnemonics with JButton
Create a Toggle Button
Create Check Boxes
Create Radio Buttons
Input Text with JTextField
Bonus Example: Cut, Copy, and Paste
Work with JList
Use a Scroll Bar
Use JScrollPane to Handle Scrolling
Display Data in a JTable
Handle JTable Events
Display Data in a JTree
Create a Main Menu
Potpourri
Access a Resource via an HTTP Connection
Use a Semaphore
Return a Value from a Thread
Use Reflection to Obtain Information about a Class at Runtime
Bonus Example: A Reflection Utility
Use Reflection to Dynamically Create an Object and Call Methods
Create a Custom Exception Class
Schedule a Task for Future Execution
Index
0 of .
Results for:
No results containing your search query
P. 1
CookBook Java

CookBook Java

Ratings: (0)|Views: 68|Likes:
Published by Javier De La Cruz

More info:

Published by: Javier De La Cruz on Feb 11, 2013
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

08/30/2013

pdf

text

original

You're Reading a Free Preview
Pages 11 to 125 are not shown in this preview.
You're Reading a Free Preview
Pages 136 to 312 are not shown in this preview.
You're Reading a Free Preview
Pages 323 to 390 are not shown in this preview.
You're Reading a Free Preview
Pages 406 to 546 are not shown in this preview.

Activity (3)

You've already reviewed this. Edit your review.
1 thousand reads
1 hundred reads
shabbir2025 liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->