没有合适的资源?快使用搜索试试~ 我知道了~
Sams teach Yourself Java in 24 hours
1星 需积分: 16 41 下载量 163 浏览量
2014-09-03
21:24:43
上传
评论 1
收藏 7.17MB PDF 举报
温馨提示
试读
434页
An excellent self-learning book for Java beginners
资源推荐
资源详情
资源评论
ptg6904740
From the Library of Elizabeth Dickerson
ptg6904740
800 East 96th Street, Indianapolis, Indiana, 46240 USA
24
in
Hours
Sams Teach Yourself
Java
™
Sixth Edition
From the Library of Elizabeth Dickerson
ptg6904740
Sams Teach Yourself Java
™
in 24 Hours, Sixth Edition
Copyright © 2012 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 other-
wise, 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 responsi-
bility for errors or omissions. Nor is any liability assumed for damages resulting from the
use of the information contained herein.
ISBN-13: 978-0-672-33575-4
ISBN-10: 0-672-33575-1
Library of Congress Cataloging-in-Publication Data:
Cadenhead, Rogers.
Sams teach yourself Java in 24 hours / Rogers Cadenhead.
p. cm.
ISBN-13: 978-0-672-33575-4 (pbk.)
ISBN-10: 0-672-33575-1 (pbk.)
1. Java (Computer program language) I. Title.
QA76.73.J38C335 2012
005.13’3—dc23
2011038994
Printed in the United States of America
First Printing October 2011
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 enti-
ty with respect to any loss or damages arising from the information contained in this book.
Bulk Sales
Sams Publishing offers excellent discounts on this book when ordered in quantity for bulk
purchases or special sales. For more information, please contact
U.S. Corporate and Government Sales
1-800-382-3419
corpsales@pearsontechgroup.com
For sales outside the United States, please contact
International Sales
international@pearson.com
Acquisitions Editor
Mark Taber
Development Editor
Songlin Qiu
Managing Editor
Sandra Schroeder
Senior Project Editor
Tonya Simpson
Copy Editor
Charlotte Kughen,
The Wordsmithery LLC
Indexer
Larry Sweazy
Proofreader
Apostrophe Editing
Services
Technical Editor
Boris Minkin
Publishing Coordinator
Vanessa Evans
Book Designer
Gary Adair
Compositor
TnT Design, Inc
From the Library of Elizabeth Dickerson
ptg6904740
Contents at a Glance
Introduction
Part I: Getting Started
Hour 1: Becoming a Programmer 3
2 Writing Your First Program 13
3 Vacationing in Java 25
4 Understanding How Java Programs
Work 39
Part II: Learning the Basics of
Programming
5 Storing and Changing Information in a
Program 49
6 Using Strings to Communicate 65
7 Using Conditional Tests to Make
Decisions 79
8 Repeating an Action with Loops 95
Part III: Working with Information in
New Ways
9 Storing Information with Arrays 107
10 Creating Your First Object 121
11 Describing What Your Object Is Like 137
12 Making the Most of Existing Objects 155
Part IV: Programming a Graphical User
Interface
13 Building a Simple User Interface 169
14 Laying Out a User Interface 187
15 Responding to User Input 201
16 Building a Complex User Interface 219
Part V: Moving into Advanced Topics
17 Creating Interactive Web Programs 235
18 Handling Errors in a Program 249
19 Creating a Threaded Program 265
20 Reading and Writing Files 283
Part VI: Writing Internet Applications
21 Reading and Writing XML Data 299
22 Creating Web Services with JAX-WS 313
23 Creating Java2D Graphics 327
24 Writing Android Apps 343
Part VII: Appendixes
A Using the NetBeans Integrated
Development Environment 373
B Where to Go from Here: Java
Resources 381
C This Book’s Website 387
D Setting Up an Android Development
Environment 389
Index 397
From the Library of Elizabeth Dickerson
ptg6904740
Table of Contents
INTRODUCTION 1
PART I:
Getting Started
HOUR 1: Becoming a Programmer
Choosing a Language ....................................4
Telling the Computer What to Do
......................5
How Programs Work
......................................7
When Programs Don’t Work
............................8
Choosing a Java Programming Tool
..................8
Installing a Java Development Tool
..................9
HOUR 2:
Writing Your First Program
What You Need to Write Programs..................13
Creating the
Saluton Program ......................14
Beginning the Program
................................14
Storing Information in a Variable
....................17
Saving the Finished Product
..........................18
Compiling the Program into a Class File
..........19
Fixing Errors
................................................19
Running a Java Program
..............................20
HOUR 3:
Vacationing in Java
First Stop: Oracle ........................................25
Going to School with Java
............................27
Lunch in JavaWorld
......................................29
Watching the Skies at NASA
..........................31
Getting Down to Business
............................32
Stopping by Java Boutique for Directions
........33
Running Java on Your Phone
..........................35
HOUR 4:
Understanding How Java Programs
Work
Creating an Application ................................39
Sending Arguments to Applications
................41
Creating an Applet
......................................42
PART II:
Learning the Basics of
Programming
HOUR 5: Storing and Changing Information in
a Program
Statements and Expressions ........................49
Assigning Variable Types
..............................50
Naming Your Variables
..................................54
Storing Information in Variables
....................54
All About Operators
......................................55
Using Expressions
......................................59
HOUR 6:
Using Strings to Communicate
Storing Text in Strings ..................................65
Displaying Strings in Programs
......................66
Using Special Characters in Strings
................67
Pasting Strings Together
..............................68
Using Other Variables with Strings
..................68
Advanced String Handling
............................70
Presenting Credits
......................................72
HOUR 7:
Using Conditional Tests to Make
Decisions
if Statements ............................................79
if-else Statements ....................................83
switch Statements ......................................84
The Conditional Operator
..............................86
Watching the Clock
......................................87
HOUR 8:
Repeating an Action with Loops
for Loops ..................................................95
while Loops ..............................................98
do-while Loops ..........................................99
Exiting a Loop
..........................................100
Naming a Loop
..........................................101
Testing Your Computer Speed
......................102
From the Library of Elizabeth Dickerson
剩余433页未读,继续阅读
资源评论
- lyvvv2014-12-09很清晰,可惜是英语的,谢谢
xiaofeimaggie
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于Qt+opencv+C++实现图像旋转+自动&&手动+直线检测,角度计算+界面操作+源码(期末大作业&课程设计&项目开发)
- 基于servlet的简单游戏管理系统
- matlab基于混沌系统的图像加密.zip
- Fortran语言教程,详细地介绍了Fortran语言
- (函数)图论中最短路径计算D算法MATLAB源代码,修改网络上D算法的错误,并编写通用的MATLAB函数.rar
- 基于matlab 2Dijkstra最短路径算法的matlab程序,希望对大家有所帮助.zip
- python入门学习,基础语法,用法等.zip
- Swift代码转换指南(Swift Swift Code Convension Guide .)
- Python入门到精通.zip
- 基于QT+C++开发的炫酷九宫格主界面+源码
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功