Home Page Icon
Home Page
Table of Contents for
Part II: Learning the Basics of Programming
Close
Part II: Learning the Basics of Programming
by Rogers Cadenhead
Sams Teach Yourself Java™ in 24 Hours, Sixth Edition
Title Page
Copyright Page
Contents at a Glance
Table of Contents
About the Author
Dedication
Acknowledgments
Reader Acknowledgments
We Want to Hear from You!
Reader Services
Introduction
Part I: Getting Started
Hour 1. Becoming a Programmer
Choosing a Language
Telling the Computer What to Do
How Programs Work
When Programs Don’t Work
Choosing a Java Programming Tool
Installing a Java Development Tool
Hour 2. Writing Your First Program
What You Need to Write Programs
Creating the Saluton Program
Beginning the Program
Storing Information in a Variable
Saving the Finished Product
Compiling the Program into a Class File
Fixing Errors
Running a Java Program
Hour 3. Vacationing in Java
First Stop: Oracle
Going to School with Java
Lunch in JavaWorld
Watching the Skies at NASA
Getting Down to Business
Stopping by Java Boutique for Directions
Running Java on Your Phone
Hour 4. Understanding How Java Programs Work
Creating an Application
Sending Arguments to Applications
Creating an Applet
Part II: Learning the Basics of Programming
Hour 5. Storing and Changing Information in a Program
Statements and Expressions
Assigning Variable Types
Naming Your Variables
Storing Information in Variables
All About Operators
Using Expressions
Hour 6. Using Strings to Communicate
Storing Text in Strings
Displaying Strings in Programs
Using Special Characters in Strings
Pasting Strings Together
Using Other Variables with Strings
Advanced String Handling
Presenting Credits
Hour 7. Using Conditional Tests to Make Decisions
if Statements
if-else Statements
switch Statements
The Conditional Operator
Watching the Clock
Hour 8. Repeating an Action with Loops
for Loops
while Loops
do-while Loops
Exiting a Loop
Naming a Loop
Testing Your Computer Speed
Part III: Working with Information in New Ways
Hour 9. Storing Information with Arrays
Creating Arrays
Using Arrays
Multidimensional Arrays
Sorting an Array
Counting Characters in Strings
Hour 10. Creating Your First Object
How Object-Oriented Programming Works
Objects in Action
What Objects Are
Understanding Inheritance
Building an Inheritance Hierarchy
Converting Objects and Simple Variables
Creating an Object
Hour 11. Describing What Your Object Is Like
Creating Variables
Creating Class Variables
Creating Behavior with Methods
Putting One Class Inside Another
Using the this Keyword
Using Class Methods and Variables
Hour 12. Making the Most of Existing Objects
The Power of Inheritance
Establishing Inheritance
Working with Existing Objects
Storing Objects of the Same Class in Vectors
Creating a Subclass
Part IV: Programming a Graphical User Interface
Hour 13. Building a Simple User Interface
Swing and the Abstract Windowing Toolkit
Using Components
Creating Your Own Component
Hour 14. Laying Out a User Interface
Using Layout Managers
Laying Out an Application
Hour 15. Responding to User Input
Getting Your Programs to Listen
Setting Up Components to Be Heard
Handling User Events
Completing a Graphical Application
Hour 16. Building a Complex User Interface
Scroll Panes
Sliders
Change Listeners
Using Image Icons and Toolbars
Part V: Moving into Advanced Topics
Hour 17. Creating Interactive Web Programs
Standard Applet Methods
Putting an Applet on a Web Page
Creating an Applet
Sending Parameters from a Web Page
Handling Parameters in an Applet
Using the Object Tag
Hour 18. Handling Errors in a Program
Exceptions
Throwing Exceptions
Throwing and Catching Exceptions
Hour 19. Creating a Threaded Program
Threads
Working with Threads
Starting with init()
Catching Errors as You Set Up URLs
Handling Screen Updates in the paint() Method
Starting the Thread
Handling Mouse Clicks
Displaying Revolving Links
Hour 20. Reading and Writing Files
Streams
Writing Data to a Stream
Reading and Writing Configuration Properties
Part VI: Writing Internet Applications
Hour 21. Reading and Writing XML Data
Creating an XML File
Reading an XML File
Reading RSS Syndication Feeds
Hour 22. Creating Web Services with JAX-WS
Defining a Service Endpoint Interface
Creating a Service Implementation Bean
Publishing the Web Service
Using Web Service Definition Language Files
Creating a Web Service Client
Hour 23. Creating Java2D Graphics
Using the Font Class
Using the Color Class
Creating Custom Colors
Drawing Lines and Shapes
Baking a Pie Graph
Hour 24. Writing Android Apps
Introduction to Android
Creating an Android App
Running the App
Designing a Real App
Part VII: Appendixes
Appendix A. Using the NetBeans Integrated Development Environment
Installing NetBeans
Creating a New Project
Creating a New Java Class
Running the Application
Fixing Errors
Appendix B. Where to Go from Here: Java Resources
Other Books to Consider
Oracle’s Official Java Site
Other Java Websites
Job Opportunities
Appendix C. This Book’s Website
Appendix D. Setting Up an Android Development Environment
Getting Started
Installing Eclipse
Installing Android SDK
Installing the Android Plug-in for Eclipse
Setting Up Your Phone
Index
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Creating an Applet
Next
Next Chapter
Hour 5. Storing and Changing Information in a Program
Part II: Learning the Basics of Programming
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset