没有合适的资源?快使用搜索试试~ 我知道了~
Head First Java(英文版)
4星 · 超过85%的资源 需积分: 48 64 下载量 57 浏览量
2018-10-27
23:23:26
上传
评论 1
收藏 63.36MB PDF 举报
温馨提示
试读
690页
Head First Java(英文版)
资源推荐
资源详情
资源评论
"WPJEFNCBSBTTJOH
00NJTUBLFT
'PPMBSPVOEJO
UIF+BWB-JCSBSZ
)FBE'JSTU
+BWB
-FBSOIPXUISFBET
DBODIBOHFZPVSMJGF
.BLF+BWBDPODFQUT
TUJDLUPZPVSCSBJO
,BUIZ4JFSSB#FSU#BUFT
#FOEZPVSNJOE
BSPVOE
+BWBQV[[MFT
:PVS#SBJOPO+BWB"-FBSOFST(VJEF
.BLFBUUSBDUJWF
BOEVTFGVM(6*T
www.allitebooks.com
ix
i
Intro
Your brain on Java.
Who is this book for? xxii
What your brain is thinking xxiii
Metacognition xxv
Bend your brain into submission xxvii
What you need for this book xxviii
Technical editors xxx
Acknowledgements xxxi
Table of Contents (summary)
Intro xxi
1 Breaking the Surface: a quick dip 1
2 A Trip to Objectville: yes, there will be objects 27
3 Know Your Variables: primitives and references 49
4 How Objects Behave: object state affects method behavior 71
5 Extra-Strength Methods: flow control, operations, and more 95
6 Using the Java Library: so you don’t have to write it all yourself 125
7 Better Living in Objectville: planning for the future 165
8 Serious Polymorphism: exploiting abstract classes and interfaces 197
9 Life and Death of an Object: constructors and memory management 235
10 Numbers Matter: math, formatting, wrappers, and statics 273
11 Risky Behavior: exception handling 315
12 A Very Graphic Story: intro to GUI, event handling, and inner classes 353
13 Work on Your Swing: layout managers and components 399
14 Saving Objects: serialization and I/O 429
15 Make a Connection: networking sockets and multithreading 471
16 Data Structures: collections and generics 529
17 Release Your Code: packaging and deployment 581
18 Distributed Computing: RMI with a dash of servlets, EJB, and Jini 607
A Appendix A: Final code kitchen 649
B Appendix B: Top Ten Things that didn’t make it into the rest of the book 659
Index 677
Table of Contents (the full version)
www.allitebooks.com
x
You Bet
Shoot Me
2
A Trip to Objectville
I was told there would be objects.
1
Breaking the Surface
Java takes you to new places.
The way Java works 2
Code structure in Java 7
Anatomy of a class 8
The main() method 9
Looping 11
Conditional branching (if tests) 13
Coding the “99 bottles of beer” app 14
Phrase-o-matic 16
Fireside chat: compiler vs. JVM 18
Exercises and puzzles 20
Method Party()
0 aload_0
1 invokespe-
cial #1 <Method
java.lang.Object()>
4 return
Compiled
bytecode
Virtual
Machines
Chair Wars (Brad the OO guy vs. Larry the procedural guy) 28
Inheritance (an introduction) 31
Overriding methods (an introduction) 32
What’s in a class? (methods, instance variables) 34
Making your fi rst object 36
Using main() 38
Guessing Game code 39
Exercises and puzzles 42
www.allitebooks.com
xi
pass-by-value means
pass-by-copy
3
Know Your Variables
Variables come in two flavors:
primitive and reference.
Dog reference
D
o
g
o
b
j
e
c
t
size
24
int
fido
4
How Objects Behave
State affects behavior,
behavior affects state.
00000111
int
X
00000111
int
Z
copy of x
foo.go(x); void go(int z){ }
Declaring a variable (Java cares about type) 50
Primitive types (“I’d like a double with extra foam, please”) 51
Java keywords 53
Reference variables (remote control to an object) 54
Object declaration and assignment 55
Objects on the garbage-collectible heap 57
Arrays (a fi rst look) 59
Exercises and puzzles 63
Methods use object state (bark different) 73
Method arguments and return types 74
Pass-by-value (the variable is always copied) 77
Getters and Setters 79
Encapsulation (do it or risk humiliation) 80
Using references in an array 83
Exercises and puzzles 88
www.allitebooks.com
xii
5
Extra-Strength Methods
Let’s put some muscle in our
methods.
6
Using the Java Library
Java ships with hundreds of pre-built classes.
We’re gonna build the
Sink a Dot Com game
- Julia, 31, hand model
Building the Sink a Dot Com game 96
Starting with the Simple Dot Com game (a simpler version) 98
Writing prepcode (pseudocode for the game) 100
Test code for Simple Dot Com 102
Coding the Simple Dot Com game 103
Final code for Simple Dot Com 106
Generating random numbers with Math.random() 111
Ready-bake code for getting user input from the command-line 112
Looping with for loops 114
Casting primitives from a large size to a smaller size 117
Converting a String to an int with Integer.parseInt() 117
Exercises and puzzles 118
Analying the bug in the Simple Dot Com Game 126
ArrayList (taking advantage of the Java API) 132
Fixing the DotCom class code 138
Building the real game (Sink a Dot Com) 140
Prepcode for the real game 144
Code for the real game 146
boolean expressions 151
Using the library (Java API) 154
Using packages (import statements, fully-qualifi ed names) 155
Using the HTML API docs and reference books 158
Exercises and puzzles 161
www.allitebooks.com
剩余689页未读,继续阅读
资源评论
- 丑丑仔仔2020-04-23有水印!!!你最好把它去掉再说
- longbo5672022-10-28不是扫描版,是文字版,可以选定里面的单词,有道可以直接翻译.就这点可以秒杀其他版本. #完美解决问题
Blair.Xu
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 全卷积网络基于voc2012数据集简单pytorch实现
- pycharm的一些介绍-用于更好的学习python
- 基于C++的程序设计大赛天梯赛L2答案(天梯赛)
- 基于python实现的三次样条插值和均值插值法实现
- Python语言教程2-python批量图片大小处理-多文件夹
- Python语言教程1-python批量图片重命名,将后缀某几个不想要的字去除
- Space Combat Kit 太空战斗套件Unity游戏开发插件资源unitypackage C#
- Universal Device Preview 通用设备预览Unity游戏开发插件资源unitypackage
- Paladin Anim Set 圣骑士动画集Unity游戏动作动画插件资源unitypackage
- 计算机财务管理期末考报表部分题目及答案.doc
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功