首页  软件  游戏  图书  电影  电视剧

请输入您要查询的图书:

 

图书 Java程序设计与问题解决(基础篇英文版第4版)/图灵原版计算机科学系列
内容
编辑推荐

这是国外高校采用率很高的Java程序设计经典教材。书中以Java基础知识为主,包括基本类型、字符串、控制流、类和方法的定义、数组、继承等,此外,还介绍了一些编程技巧。书本使用了J2SE 5.0的最新特性,并且包含新的可选讲的图形编程内容和贯穿全书的GUI材料。该书内容高度协调,包含自测题、编程提示和编程项目以及关于编程缺陷和容易出错的程序语言特征的章节。适合作为高等院校计算机专业本科生或研究生Java语言程序设计课程的教材,也适合相关技术人员参考。

内容推荐

本书是国外高校采用率很高的Java程序设计经典教材。书中以Java基础知识为主,包括基本类型、字符串、控制流、类和方法的定义、数组、继承等,此外,还介绍了一些编程技巧。本书使用了J2SE 5.0的最新特性,并且包含新的可选讲的图形编程内容和贯穿全书的GUI材料。本书内容高度协调,包含自测题、编程提示和编程项目以及关于编程缺陷和容易出错的程序语言特征的章节。

本书适合作为高等院校计算机专业本科生或研究生Java语言程序设计课程的教材,也适合相关技术人员参考。

目录

CHAPTER 1 Introduction to Computers and Java 3

   Objectives 4

   Prerequisites 4

 1.1 Computer Basics 5

   Hardware and Memory 5

   Programs 7

   Programming Languages and Compilers 9

   Java Byte-Code 10

   Class Loader 12

 1.2 Designing Programs 13

   Object-Oriented Programming 13

   Encapsulation 14

   Polymorphism 15

   Inheritance 16

   If You Know Some Other Programming Language 17

   Algorithms 17

   Reusable Components 18

   Testing and Debugging 19

 1.3 A Sip of Java 21

   History of the Java Language 21

   Applets 22

   A First Java Application Program 22

   Compiling a Java Program or Class 27

   Running a Java Program 29

 1.4 Graphics Supplement (Optional) 29

   Objects and Methods 30

   A Sample Graphics Applet 30

   Size and Positions of Figures 33

   Drawing Arcs 36

   Running an Applet 36

   Chapter Summary 39

   Answers to Self-Test Questions 40

   Programming Projects 42

CHAPTER 2 Primitive Types, Strings, and Console I/O 45

   Objectives 46

   Prerequisites 46

 2.1 Primitive Types and Expressions 47

   Variables 47

   Java Identifiers 51

   Primitive Types 52

   Assignment Statements 53

   Specialized Assignment Operators 55

   Simple Screen Output 56

   Simple Input 56

   Number Constants 58

   Assignment Compatibilities 59

   Type Casting 61

   Programming Tip: Initialize Variables 63

   Arithmetic Operators 66

   Parentheses and Precedence Rules 67

   Case Study: Vending Machine Change 69

   Increment and Decrement Operators 74

   More about the Increment and Decrement Operators 75

 2.2 The Class String 76

   String Constants and Variables 76

   Concatenation of Strings 77

   Classes 78

   String Methods 79

   String Processing 83

   Escape Characters 84

   The Unicode Character Set 85

 2.3 Keyboard and Screen I/O 87

   Screen Output 87

   Keyboard Input 90

 2.4 Documentation and Style 98

   Programming Tip: Use Meaningful Names for Variables 99

   Documentation and Comments 99

   Indenting 102

   Named Constants 102

 2.5 Graphics Supplement (Optional) 106

   Programming Example: Style Rules Applied to a Graphics Applet 106

   JOpti onPane 106

   Inputting Other Numeric Types 115

   Programming Example: Change-Making Program with Windowing I/O 117

   Chapter Summary 120

   Answers to Self-Test Questions 120

   Programming Projects 125

CHAPTER 3 F1ow of Contro1 129

   Objectives 130

   Prerequisites 130

 3.1 Branching Statements 130

   The if-eIse Statement 130

   Introduction to Boolean Expressions 134

   Programming Tip: Alphabetical Order 139

   Nested Statements and Compound Statements 142

   Multibranch if-e1se Statements 145

   Programming Example: Assigning Letter Grades 146

   The switch Statement 149

   The Conditional Operator (Optional) 153

 3.2 Java Loop Statements 155

   whi1e Statements 156

   The do-whi1e Statement 160

   Programming Example: Bug Infestation 164

   The for Statement 168

   The Comma in for Statements (Optional) 172

   The break Statement in Loops 175

   The exit Method 177

 3.3 Programming with Loops 179

   The Loop Body 179

   Initializing Statements 181

   Ending a Loop 182

   Programming Example: Nested Loops 183

   Programming Tip: Avoid Declaring Variables in a Loop Body 184

   Loop Bugs 184

   Tracing Variables 188

 3.4 The Type boo] ean 189

   Boolean Expressions and Boolean Variables 190

   Programming Tip: Naming Boolean Variables 191

   Precedence Rules 192

   Input and Output of Boolean Values 195

   Case Study: Using a Boolean Variable to End a Loop 195

 3.5 Graphics Supplement (Optional) 199

   Specifying a Drawing Color 199

   Programming Example: A Multiface Applet 203

   The drawString Method 208

   A JOptionPane Yes/No Window 209

   Chapter Summary 211

   Answers to Self-Test Questions 211

   Programming Projects 217

CHAPTER 4 Defining Classes and Methods 221

   Objectives 222

   Prerequisites 222

 4.1 Class and Method Definitions 222

   Class Files and Separate Compilation 224

   Instance Variables 225

   Using Methods 228

   void Method Definitions 231

   Methods That Return a Value 233

   The this Parameter 238

   Local Variables 240

   Blocks 242

   Parameters of a Primitive Type 243

   Summary of Class and Method Definition Syntax 249

 4.2 Information Hiding and Encapsulation 250

   Information Hiding 250

   Programming Tip: Parameter Names Are Local to the Method 251

   Precondition and Postcondition Comments 251

   The public and private Modifiers 254

   Programming Tip: Instance Variables Should Be prirate 257

   Programming Example: A Purchase Class 261

   Encapsulation 265

   Automatic Documentation with javadoc 268

   UML Class Diagrams 268

 4.3 Objects and Reference 270

   Variables of a Class Type and Objects 270

   Programming Example: A Species Class 279

   Boolean-Valued Methods 282

   Class Parameters 284

   Comparing Class Parameters and Primitive-Type Parameters 287

   4.4 Graphics Supplement (Optional) 291

   The G raphi cs Class 291

   Programming Example: Multiple Faces Redone with a Helping Method 294

   The init Method 298

   Adding Labels to an Applet 298

   Chapter Summary 302

   Answers to Self-Test Questions 303

   Programming Projects 310

CHAPTER 5 More About Objects and Methods 315

   Objectives 316

   Prerequisites 316

 5.1 Programming with Methods 317

   Methods Calling Methods 317

   Programming Tip: Make Helping Methods Private 323

 5.2 Static Methods and Static Variables 326

   Static Methods 326

   Static Variables (Optional) 332

   The Math Class 334

   Integer, Double, and Other Wrapper Classes 337

 5.3 Designing Methods 343

   Case Study: Formatting Output 343

   Top-Down Design 348

   Testing Methods 350

 5.4 Overloading 352

   Overloading Basics 352

   Programming Example: A Pet Class 355

   Programming Example: A Class for Money 363

 5.5 Constructors 369

   Defining Constructors 370

   Programming Tip: You Can Use Other Methods in a Constructor 378

 5.6 Information Hiding Revisited 380

 5.7 Packages 384

   Packages and Importing 384

   Package Names and Directories 385

   Name Clashes 388

 5.8 Graphics Supplement (Optional) 389

   Programming Tip: Code Appearance and Actions Separately 389

   Adding Buttons 390

   Event-Driven Programming 391

   Programming Example: A Complete Button Applet 391

   Programming Buttons 392

   Icons 399

   Changing Visibility 401

   Programming Example: An Example of Changing Visibility 4Ol

   What's Next 405

   Chapter Summary 405

   Answers to Self-Test Questions 406

   Programming projects 412

CHAPTER 6 Arrays 417

   Objectives 418

   Prerequisites 418

 6.1 Array Basics 419

   Creating and Accessing Arrays 419

   Array Details 420

   Programming Tip: Use Singular Array Names 424

   The 1ength Instance Variable 425

   Programming Tip: Use a for Loop to Step Through an Array 427

   Initializing Arrays 429

 6.2 Arrays in Classes and Methods 430

   Case Study: Sales Report 430

   Indexed Variables as Method Arguments 438

   Entire Arrays as Method Arguments 440

   Arguments for the Method mai n 441

   Methods That Return Arrays 446

 6.3 Programming with Arrays and Classes 449

   Programming Example: A Specialized List Class 450

   Partially Filled Arrays 457

   Searching an Array 457

 6.4 Sorting Arrays 460

   Selection Sort 460

   Other Sorting Algorithms 465

 6.5 Multidimensional Arrays 465

   Multidimensional-Array Basics 467

   Multidimensional-Array Parameters and Returned Values 470

   Implementation of Multidimensional Arrays 471

   Ragged Arrays (Optional) 475

   Programming Example: Employee Time Records 476

 6.6 Graphics Supplement (Optional) 482

   Graphics Supplement Part 1: Text Areas and Text Fields 483

   Programming Example: A Question-and-Answer Applet 483

   JTextArea and JTextFi el d Objects 483

   Graphics Supplement Part 2: Drawing Polygons 487

   Drawing Polygons 487

   Chapter Summary 491

   Answers to Self-Test Questions 492

   Programming Projects 497

CHAPTER 7 Inheritance 501

   Objectives 502

   Prerequisites 502

 7.1 Inheritance Basics 502

   Programming Example: A Person Class 503

   Derived Classes 504

   Overriding Method Definitions 507

   Overriding Versus Overloading 508

   The final Modifier 508

   Programming Tip: Assume That Your Coworkers Are Malicious 510

   UML Inheritance Diagrams 510

 7.2 Programming with Inheritance 513

   Constructors in Derived Classes 513

   The this Method (Optional) 514

   Call to an Overridden Method 515

   Programming Example: Multilevel Derived Classes 516

   A Subtle Point About Overloading and Overriding (Optional) 521

   Programming Tip: An Object Can Have More than One Type 522

   Programming Tip: “Is a” and “Has a” Relations 525

   The Class Object 526

   Case Study: Character Graphics 528

   Abstract Classes 538

   Interfaces 542

 7.3 Dynamic Binding and Polymorphism 544

   Dynamic Binding 544

   Type Checking and Dynamic Binding 546

   Dynamic Binding with toString 547

   Polymorphism 548

 7.4 Graphics Supplement (Optional) 551

   The Class JApplet 551

   The Class JFrame 552

   Window Events and Window Listeners 555

   The ActionListener Interface 556

   Programming Example: Happy Face as a JFrame 557

   What To Do Next 558

   Chapter Summary 559

   Answers to Self-Test Questions 559

   Programming Projects 565

标签
缩略图
书名 Java程序设计与问题解决(基础篇英文版第4版)/图灵原版计算机科学系列
副书名
原作名
作者 (美)萨维奇
译者
编者
绘者
出版社 人民邮电出版社
商品编码(ISBN) 9787115152886
开本 16开
页数 567
版次 1
装订 平装
字数 750
出版时间 2006-12-01
首版时间 2006-12-01
印刷时间 2006-12-01
正文语种
读者对象 青年(14-20岁),研究人员,普通成人
适用范围
发行范围 公开发行
发行模式 实体书
首发网站
连载网址
图书大类
图书小类
重量 0.92
CIP核字
中图分类号 TP312
丛书名
印张 36.75
印次 1
出版地 北京
232
186
25
整理
媒质 图书
用纸 普通纸
是否注音
影印版本 原版
出版商国别 CN
是否套装 单册
著作权合同登记号 图字01-2006-5776号
版权提供者 Pearson Education Asia Ltd.
定价
印数 3000
出品方
作品荣誉
主角
配角
其他角色
一句话简介
立意
作品视角
所属系列
文章进度
内容简介
作者简介
目录
文摘
安全警示 适度休息有益身心健康,请勿长期沉迷于阅读小说。
随便看

 

兰台网图书档案馆全面收录古今中外各种图书,详细介绍图书的基本信息及目录、摘要等图书资料。

 

Copyright © 2004-2025 xlantai.com All Rights Reserved
更新时间:2025/5/6 10:54:28