Sams teach yourself programming with java in 24 hours 4th edition oct 2005 ISBN 0672328445

1.2K 188 0
Sams teach yourself programming with java in 24 hours 4th edition oct 2005 ISBN 0672328445

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

SAMS Teach Yourself Programming with Java™ in 24 Hours, FOURTH EDITION By Rogers Cadenhead Publisher: Sams Pub Date: September 30, 2005 ISBN: 0-672-32844-5 Pages: 576 Table of Contents | Index If you have been wanting to learn Java, check out the newly revised fourth edition of the best-seller Sams Teach Yourself Programming with Java in 24 Hours This stepby-step tutorial will teach you how to create simple Java programs and applets Comprised of 24 one-hour lessons, this new edition focuses on key programming concepts and essential Java basics, has been improved by dozens of reader comments, and is reorganized to better cover the latest developments in Java The book's coverage of core Java programming topics has also been expanded A great starting point for learning Java, this book is also a great primer to reading sams Teach Yourself Java in 21 Days SAMS Teach Yourself Programming with Java™ in 24 Hours, FOURTH EDITION By Rogers Cadenhead Publisher: Sams Pub Date: September 30, 2005 ISBN: 0-672-32844-5 Pages: 576 Table of Contents | Index Copyright About the Author Acknowledgments Reader Acknowledgements 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 How Programs Don't Work Next Stop: Java Workshop: Installing a Java Development Tool Summary Q&A Quiz Activities Hour 2 Writing Your First Program What You Need to Write Programs Creating the Saluton Program Storing Information in a Variable Saving the Finished Product Compiling the Program into a Class File Fixing Errors Workshop: Running a Java Program Summary Q&A Quiz Activities Hour 3 Vacationing in Java First Stop: Sun Microsystems Going to School with Java Lunch in JavaWorld Watching the Skies at NASA Getting Down to Business Stopping by Gamelan to Ask Directions Workshop: Venturing into Another World Summary Q&A Quiz Activities Hour 4 Understanding How Java Programs Work Creating an Application Sending Arguments to Applications Applet Basics Sending Parameters to Applets Workshop: Viewing the Code Used to Run Applets Summary Q&A Quiz Activities 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 Workshop: Using Expressions All about Operators Summary Q&A Quiz Activities 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 Workshop: Presenting Credits Summary Q&A Quiz Activities Hour 7 Using Conditional Tests to Make Decisions Testing a Condition if Statements if-else Statements switch Statements The Conditional Operator Workshop: Watching the Clock Summary Q&A Quiz Activities Hour 8 Repeating an Action with Loops for Loops while Loops do-while Loops Exiting a Loop Naming a Loop Workshop: Teaching Your Computer a Lesson Summary Q&A Quiz Activities Part III WORKING WITH INFORMATION IN NEW WAYS Hour 9 Storing Information with Arrays Creating Arrays Using Arrays Multidimensional Arrays Sorting an Array Workshop: Array of Prizes, Indeed Summary Q&A Quiz Activities 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 Workshop: Creating an Object Summary Q&A Quiz Activities 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 Workshop: Using Class Methods and Variables Summary Q&A Quiz Activities 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 Workshop: Creating a Subclass Summary Q&A Quiz Activities Part IV Programming a Graphical User Interface Hour 13 Building a Simple User Interface Swing and the Abstract Windowing Toolkit Using Components Workshop: Creating Your Own Component Summary Q&A Quiz Activities Hour 14 Laying Out a User Interface Using Layout Managers Workshop: Laying Out an Application Summary Q&A Quiz Activities Hour 15 Responding to User Input Getting Your Programs to Listen Setting Up Components to Be Heard Handling User Events Workshop: A Little Lotto Madness Summary Q&A Quiz Activities Hour 16 Building a Complex User Interface Scroll Panes Sliders Change Listeners Menus Workshop: Using Image Icons and Toolbars Summary Q&A Quiz Activities Part V Creating Multimedia Programs Hour 17 Creating Interactive Web Programs Standard Applet Methods Putting an Applet on a Web Page A Sample Applet The Java Plug-in Sending Parameters from a Web Page Receiving Parameters in the Applet Workshop: Handling Parameters in an Applet Java Web Start Using Java Web Start Summary Q&A Quiz Activities Hour 18 Handling Errors in a Program Exceptions Assertions Workshop: Throwing and Catching Exceptions Summary Q&A Quiz Activities 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 Workshop: Revolving Links Summary Q&A Quiz Activities Hour 20 Reading and Writing Files Streams Writing Data to a Stream Reading and Writing Configuration Properties Workshop: Writing Bytes to an MP3 File Summary Q&A Quiz Activities Part VI Creating Multimedia Programs Hour 21 Reading and Writing XML Data Creating an XML File Reading an XML File Workshop: Reading RSS Syndication Feeds Summary Q&A Quiz Activities Hour 22 Using Fonts and Color Using the Font Class Using the Color Class Other Ways to Choose Colors Workshop: Displaying a Danger Message Summary Q&A Quiz Activities Hour 23 Working with Graphics Using Graphics Drawing Lines and Shapes Workshop: Baking a Pie Graph Summary Q&A Quiz Activities Hour 24 Creating Animation Animating a Sequence of Images Sending Parameters to the Applet Workshop: Follow the Bouncing Ball Summary Q&A Quiz Activities Part VII Bonus… Hour 25 Creating Web Services with XML-RPC Working with Apache XML-RPC Creating an XML-RPC Handler Creating an XML-RPC Server Creating an XML-RPC Client Workshop: Enhancing the LottoMadness Application Summary Q&A Quiz Activities Part VIII Appendixes Appendix A Using the Java Development Kit Choosing a Java Development Tool Configuring the Java Development Kit Using a Text Editor Creating a Sample Program Setting Up the CLASSPATH Variable Appendix B Programming with the Java Development Kit An Overview of the JDK The java Interpreter The javac Compiler The appletviewer Browser The javadoc Documentation Tool The jar Java File Archival Tool The jdb Debugger Using System Properties Summary Q&A Appendix C Using the NetBeans Integrated Development Environment Choosing a Java Development Tool Creating a Sample Program Appendix D Where to Go from Here: Java Resources Other Books to Consider Sun's Official Java Site Other Java Websites Java Newsgroups Internet Relay Chat Job Opportunities Appendix E This Book's Website Sun Microsystems, Inc Binary Code License Agreement JAVA™ DEVELOPMENT TOOLS JAXP.JAR AND PARSER.JAR ARCHIVE FILES FROM JAVA API FOR XML PARSING, VERSION 1.0 SUPPLEMENTAL LICENSE TERMS JAVAHELP™ VERSION 2.0 SUPPLEMENTAL LICENSE TERMS JAVA™ DEVELOPMENT TOOLS JAVAC COMPILER SUPPLEMENTAL LICENSE TERMS JAVA™ INTERFACE CLASSES J2EE™ DEPLOYMENT SPECIFICATION INTERFACE CLASSES 1.1 SUPPLEMENTAL LICENSE TERMS JAVA 2, ENTERPRISE EDITION (J2EE™) MANAGEMENT, VERSION 1.0 JAVA™ INTERFACE CLASSES SUPPLEMENTAL LICENSE TERMS JAVA™ INTERFACE CLASSES ENTERPRISE JAVABEANS™, VERSION 2.0, INTERFACE CLASSES SUPPLEMENTAL LICENSE TERMS JAVA™ OPTIONAL PACKAGE JMX™, VERSION 1.2 SUPPLEMENTAL LICENSE TERMS J2EEeditor.jar SUPPLEMENTAL LICENSE TERMS resolver-1_1_nb.jar Based on Sun's XML Resolver 1.0 Software License Agreement What's on the CD-ROM Windows Installation Instructions UNIX and UNIX-like Installation Instructions Index Copyright Copyright © 2006 by Sams Publishing All rights reserved No part of this book shall be reproduced, stored in a retrieval system, or transmitted by any means, electronic, mechanical, photocopying, recording, or otherwise, without written permission from the publisher No patent liability is assumed with respect to the use of the information contained herein Although every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions Nor is any liability assumed for damages resulting from the use of the information contained herein Library of Congress Catalog Card Number: 2005928293 Printed in the United States of America First Printing: October 2005 08 07 06 05 4 3 2 1 Trademarks All terms mentioned in this book that are known to be trademarks or service marks have been appropriately capitalized Sams Publishing cannot attest to the accuracy of this information Use of a term in this book should not be regarded as affecting the validity of any trademark or service mark Warning and Disclaimer Every effort has been made to make this book as complete and as accurate as possible, but no warranty or fitness is implied The information provided is on an "as is" basis The author and the publisher shall have neither liability nor responsibility to any person or entity with respect to any loss or damages arising toUpperCase() method 2nd troubleshooting [See also debugging] applets loading errors JDK configuration errors 2nd JDK installations trusted developers try-catch blocks catching exceptions 2nd 3rd 4th 5th 6th 7th 8th DivideNumbers sample application 2nd SumNumbers sample application 2nd 3rd 4th 5th try-catch statement 2nd try-catch-finally blocks 2nd tuned quicksorts (arrays) type values (variables) casting types boolean 2nd 3rd byte char 2nd 3rd long 2nd short Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] U.S Census Bureau website UltraEdit text editor Undernet.org chat rooms 2nd underscore (_) up command (jdb) updating screen paint() method 2nd repaint() method updating screens forced updates upper limits of arrays checking uppercase changing strings to 2nd 3rd Usenet newsgroups Java resources 2nd utilities appletviewer (JDK) AppInfo sample application 2nd 3rd 4th 5th Applet menu commands 2nd appletviewer browser (JDK) command line options (JDK) 2nd command line (JDK) jar (JDK) 2nd 3rd 4th java interpreter (JDK) 2nd 3rd 4th javac compiler (JDK) 2nd 3rd 4th javadoc AppInfo2 sample application tags 2nd 3rd 4th javadoc (JDK) 2nd 3rd 4th 5th 6th jdb commands 2nd jdb debugger applet debugging 2nd application debugging breakpoints 2nd 3rd commands 2nd 3rd 4th 5th 6th 7th 8th 9th 10th 11th 12th 13th 14th 15th 16th 17th 18th 19th 20th jdb debugger (JDK) application debugging breakpoints single-step execution 2nd 3rd Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] valueOf() method Variable application code listing compiling int statement variables characters 2nd declaring floating-point 2nd integers 2nd strings 2nd Variable Program (Listing 5.1) variables access control arrays 2nd 3rd declaring definition of elements initial values 2nd multidimensional 2nd ranges sample application 2nd sorting 2nd 3rd 4th 5th 6th assigning values storing 2nd 3rd casting 2nd 3rd CLASSPATH Windows 98/Me, setting (JDK) 2nd 3rd Windows NT/2000/XP, setting (JDK) 2nd 3rd converting to objects 2nd 3rd counter variables definition of initializing data types String declaring 2nd 3rd 4th class variables 2nd object variables 2nd definition of displaying contents of 2nd environment initializing definition of length 2nd naming conventions 2nd 3rd case-sensitivity PATH Windows 9x/Me 2nd 3rd Windows NT/2000/XP 2nd 3rd private protected public referencing this statement 2nd Revolve applet Revolve program scope 2nd strings 2nd casting changing case 2nd 3rd comparing 2nd concatenating 2nd declaring determining length 2nd displaying 2nd empty escape codes 2nd linking 2nd types assigning 2nd boolean 2nd 3rd byte char 2nd 3rd floating-point integers long 2nd short strings 2nd values assigning decrementing 2nd 3rd 4th incrementing 2nd 3rd 4th starting values Vector class objects storing 2nd 3rd vectors looping through 2nd 3rd 4th vendor tag (JNL) verbose option (javac) VeriSign Website vertical sliders creating vi editor writing features for programs vi text editor programs writing source code in 2nd View menu commands Page Source Source viewing documents HTML Virus application class constructor methods getSeconds() infectFile() setSeconds() tauntUser() showVirusCount() source code 2nd Virus class viruses Java program transmissions VirusLook application output source code 2nd testing Visible Human Project website Java viewer 2nd Visual Basic 2nd void keyPressed() method void keyReleased() method void keyTyped() method void statement Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] WarGames web browsers Java interpreters support for Java Plug-in Java plug-in downloading Java program execution web pages source code viewing tags cleaning up (TagCleaner) 2nd 3rd 4th 5th 6th web services Web sites array sorting technique demo Gamelan iBiolio.org InformIT JARS (Java Review Service) Java Plug-in Java Web Start JavaWorld Magazine Workbench Web Start 2nd capabilities 2nd JNLP (Java Network Launching Protocol) files 2nd 3rd 4th 5th LottoMadness example 2nd 3rd 4th 5th running applications with 2nd 3rd 4th 5th 6th 7th 8th security 2nd Web site WebServer class (XML_RPC) Websites AlphaTrade.com 2nd 3rd websites Apache.org Apple Developer NetBeans downloads Babelfish language translation features Bart Simpson Chalkboard Punishments Cafeconleche.org CareerBuilder.com CE-Mark.com chat room resources Undernet.org 2nd Websites Gamelan Java Applet Ratings Service (JARS) 2nd websites Hexadecimal Hues IANA (Internet Assigned Numbers Authority) Inflation Calculator InformIT International Components for Unicode for Java Internet Movie Database Java Applet Ratings Service (JARS) Java on the Brain Java.com Java.net Java24.com NetBeans resources Java24Hours.com applet resources 2nd features troubleshooting resources XML-RPC resources Websites JavaWorld Magazine 2nd 3rd websites Liberty BASIC interpreter NASA J-Track applet 2nd Piano, The Population Research Bureau RSS Advisory Board Sams Publishing Websites Sun 2nd websites Sun Java documentation Java documentation resources JDK downloads Websites Sun sample applets websites Sun Microsystem Java site Sun Microsystems Java Java history JDK downloads U.S Census Bureau Websites VeriSign websites Visible Humand Project Java viewer 2nd Websites Wurm Online 2nd websites XMLRPC.com well-formed data (XML) Wheel of Fortune application 2nd character arrays integer arrays letterCount array nested loops output source code 2nd string arrays Wheel of Fortune program while loops 2nd exiting 2nd WIDTH attribute (APPLET tag) windowing software windows 2nd 3rd 4th 5th 6th 7th 8th 9th Windows 98/Me CLASSPATH variable setting (JDK) 2nd 3rd Windows 9x/Me PATH variable setting (JDK) 2nd 3rd Windows Notepad text editor feaures 2nd Windows NT/2000/XP CLASSPATH variable setting (JDK) 2nd 3rd PATH variable setting (JDK) 2nd 3rd Windows OS Java programs compiling in 2nd 3rd running in 2nd 3rd JDK configuring on 2nd 3rd 4th installing on 2nd 3rd NetBeans software configuration Windows WordPad text editor feaures 2nd wizards NetBeans Installation Wizard running 2nd word processors [See text editors] programs writing in 2nd selecting for program writing WordPad programs writing source code in 2nd Workbench Web site write protecting text fields write() method WriteMail application 2nd writing configuration properties in programs 2nd 3rd writing to files streams 2nd 3rd streams 2nd 3rd Wurm Online website 2nd Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] XML (Extensible Markup Language) Builder class DOCTYPE statement Element class methods libraries downloading (CafeConLeche.org) listings Full Text of Aggregator.java (21.4) 2nd 3rd RSS syndication feeds dialect resources reading 2nd 3rd 4th XML (Extensible Markup Language) XML files creating 2nd 3rd 4th 5th 6th 7th dialects Full Text of properties.xml (Listing 21.2) 2nd 3rd 4th Full Text of PropertyFileCreator.java (Listing 21.1) 2nd indentation concerns reading 2nd 3rd 4th 5th 6th well-formed data XML Remote Procedure Call [See XML-RPC] XML-RPC [See also Apache XML-RPC] (XML Remote Procedure Call) clients creating 2nd 3rd LottoClient class 2nd 3rd directory of supported platforms handlers creating 2nd 3rd 4th 5th 6th Full Text of lotto.log (Listing 25.2) 2nd Full Text of LottoCounter.java (Listing 25.1) 2nd 3rd 4th Java24Hours.com resources protocol functions servers creating 2nd 3rd 4th 5th 6th LottoServer class 2nd 3rd 4th 5th 6th 7th 8th 9th WebServer class 2nd versus RMI (Remote Method Invocation) 2nd voids as return types XMLRPC.com XOM (XML Object Model) open source licensing ... He has written 20 books on Internetrelated topics, including Sams Teach Yourself Java 2 in 21 Days, Fourth Edition, Sams Teach Yourself Microsoft FrontPage 2003 in 24 Hours, and Radio UserLand Kick Start He maintains this book's official website at... thoroughly explained as they are introduced If I've succeeded, you will finish Sams Teach Yourself Programming with Java in 24 Hours with enough programming skill to be a danger to yourself and others... and a little free time can learn this language, the most popular programming language in use today By working your way through each of the one-hour tutorials in Sams Teach Yourself Programming with Java in 24 Hours, Fourth Edition, you'll be able to learn Java programming quickly

Ngày đăng: 26/03/2019, 16:31

Từ khóa liên quan

Mục lục

  • SAMS Teach Yourself Programming with Java in 24 Hours, FOURTH EDITION

  • Table of Contents

  • Copyright

  • About the Author

  • Acknowledgments

  • Reader Acknowledgements

  • 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

      • How Programs Don't Work

      • Next Stop: Java

      • Workshop: Installing a Java Development Tool

      • Summary

      • Q&A

      • Quiz

      • Activities

      • Hour 2. Writing Your First Program

        • What You Need to Write Programs

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan