图书介绍

THinking in Java (Third Edition)PDF|Epub|txt|kindle电子书版本下载

THinking in Java (Third Edition)
  • [美]Bruce Eckel著 著
  • 出版社: 机械工业出版社
  • ISBN:7111131657
  • 出版时间:2005
  • 标注页数:1120页
  • 文件大小:35MB
  • 文件页数:1146页
  • 主题词:JAVA语言-程序设计-英文

PDF下载


点此进入-本书在线PDF格式电子书下载【推荐-云解压-方便快捷】直接下载PDF格式图书。移动端-PC端通用
种子下载[BT下载速度快]温馨提示:(请使用BT下载软件FDM进行下载)软件下载地址页直链下载[便捷但速度慢]  [在线试读本书]   [在线获取解压码]

下载说明

THinking in Java (Third Edition)PDF格式电子书版下载

下载的文件为RAR压缩包。需要使用解压软件进行解压得到PDF格式图书。

建议使用BT下载工具Free Download Manager进行下载,简称FDM(免费,没有广告,支持多平台)。本站资源全部打包为BT种子。所以需要使用专业的BT下载软件进行下载。如BitComet qBittorrent uTorrent等BT下载工具。迅雷目前由于本站不是热门资源。不推荐使用!后期资源热门了。安装了迅雷也可以迅雷进行下载!

(文件页数 要大于 标注页数,上中下等多册电子书除外)

注意:本站所有压缩包均有解压码: 点击下载压缩包解压工具

图书目录

WhatsInside1

Preface1

Preface to the 3rdedition4

Java 2, JDK 1.46

Introduction9

Prerequisites10

Learning Java10

Goals11

JDK HTMLdocumentation12

Chapters13

Exercises20

The CD ROM20

Source code22

Coding standards24

Java versions24

Errors25

Note on the cover design25

Acknowledgements26

1: Introductionto Objects31

The progressof abstraction32

An objecthas an interface34

An objectprovides services37

The hiddenimplementation38

Reusingthe implementation40

Inheritance: reusingthe interface41

ls-a vs is-like-a relationships45

Whats InsideInterchangeable objectswith polymorphism47

Abstract base classesand interfaces51

Object creation,uselifetimes51

Collections and iterators53

The singly rooted hierarchy55

Downcasting vstemplates/generics56

Ensuring proper cleanup57

Exception handling:dealing with errors59

Concurrency60

Persistence61

Java and the Internet61

What is the Web?61

Client-side programming64

Server-side programming71

Applications72

Why Java succeeds72

Systems are easier to72

express and understand72

Maximal leveragewith libraries73

Error handling73

Programming in the large73

Java vs C++?74

Summary75

2: Everythingis an Object77

You manipulate objectsWith references77

You must createall the objects79

Where storage lives79

Special case: primitive types80

Arrays in Java82

You never need to83

destroy an object83

Scoping83

Scope of objects84

Creating newdata types: class85

Fields and methods85

Methods, arguments,and return values87

The argument list89

Building a Java program90

Name visibility90

Using other components91

The static keyword92

Your first Java program94

Compiling and running95

Comments and embeddeddocumentation97

Comment documentation97

Syntax98

Embedded HTML99

Some example tags tooDocumentation example102

Coding style103

Summa104

Exercises104

3: ControllingProgram Flow107

Using Java operators107

Precedence lobAssignment108

Mathematical operators111

Auto incrementand decrement115

Relational operators117

Logical operators119

Bitwise operators122

Shift operators123

Terna if-else operator127

The comma operator128

String operator +128

Common pitfalls whenusing operators129

Casting operators130

Java has no “sizeof133

Precedence revisited133

A compendium of operators134

Execution control144

true and false144

if-else145

return146

Iteration147

do-while148

for148

break and continue151

switch157

Summa162

Exercises162

4: Initialization Cleanup165

Guaranteed initializationwith the constructor165

Method overloading168

Distinguishingoverloaded methods171

Overloading with primitives172

Overloading on return values177

Default constructors178

The this keyword179

Cleanup: finalizationand garbage collection183

what is finalize( ) for?184

You must perform cleanup185

The termination condition186

How a garbagecollector works188

Member initialization191

Specifying initialization193

Constructor initialization194

Array initialization202

Multidimensional arrays208

Summa211

Exercises212

5: Hiding theImplementation215

package: the libra unit216

Creating uniquepackage names218

A custom tool libra222

Using importsto change behavior224

Package caveat224

Java access speciers224

Package access225

public: interface access226

private:you cant touch that!228

protected:inheritance access229

Interfaceand implementation231

Class access232

Summa236

Exercises237

6: Reusing Classes241

Composition syntax241

Inheritance syntax245

Initializing the base class248

Combining compositionand inheritance250

Guaranteeing proper cleanup252

Name hiding256

Choosing compositionvs inheritance258

protected260

Incrementaldevelopment261

Upcasting262

Why “upcasting”?263

The nal keyword264

Final data264

Final methods269

Final classes271

Final caution272

Initializationand class loading273

Initialization with inheritance274

Summary275

Exercises276

7: Polymorphism279

Upcasting revisited279

Forgetting the object type282

The twist283

Method-call binding284

Producing the right behavior284

Extensibility288

Pitfall: “overriding” privatemethods292

Abstract classesand methods293

Constructors andpolymorphism297

order of constructor calls298

Inheritance and cleanup300

Behavior of polymorphicmethods inside constructors303

Designingwith inheritance306

Pure inheritancevs extension308

Downcasting andrun-time type identication310

Summary312

Exercises313

8: Interfaces Inner Classes315

Interfaces315

“Multiple inheritance” in Java319

Extending an interfacewith inheritance323

Grouping constants324

Initializing eldsin interfaces327

Nesting interfaces328

Inner classes331

Inner classes and upcasting333

Inner classes in methodsand scopes335

Anonymous inner classes338

The link to the outer class342

Nested classes344

Referring to theouter class object347

Reaching outward from amultiply-nested class348

Inheriting from inner classes349

Can inner classesbe overridden?350

Local inner classes352

Inner class identiers354

Why inner classes?354

ClosuresCallbacks357

Inner classes control frameworks360

Summary367

Exercises367

9: Error Handlingwith Exceptions371

Basic exceptions372

Exception arguments373

Catching an exception374

The try block374

Exception handlers375

Creating yourown exceptions376

The exceptionspecication381

Catching any exception382

Rethrowing an exception384

Exception chaining388

StandardJava exceptions392

The special case ofRuntimeException392

Performing cleanupwith finally394

Whats nay for?396

Pitfall: the lost exception399

Exception restrictions400

Constructors404

Exception matching408

Alternative approaches409

History410

Perspeives412

Passing exceptionsto the console415

Converting checkedto unchecked exceptions416

Exception guidelines418

Summa419

Exercises419

10: Detecting pes423

The need for RI423

The Class object426

Checking before a cast429

RTT1 syntax441

Reection: run timeclass information444

A class method extractor446

Summa450

Exercises451

11: Collectionsof Objects453

Arrays453

Arrays are rst-class objects455

Returning an array458

The Arrays class46o469

Filling an array469

Copying an array470

Comparing arrays472

Array element comparisons473

Sorting an array476

Searching a sorted array478

Array summa480

Introductionto containers481

Printing containers482

Filling containers484

Container disadvantage:unknown type491

Sometimes it works anyway493

Making a type-consciousArrayList495

Iterators497

Container taxonomy501

Collection functionality505

List functionality509

Making a stackfrom a LinkedList513

Making a queuefrom a LinkedList514

Set functionality515

Sortedset519

Map functionality520

SortedMap525

LinkedHashMap527

Hashing and hash codes529

Overriding hashCode545

Holding references545

The WeakHashMap547

Iterators revisited549

Choosingan implementation550

Choosing between Lists551

Choosing between Sets554

Choosing between Maps557

Sorting andsearching Lists560

Utilities561

Making a Collectionor Map unmodiable564

Synchronizing aCollection or Map566

Unsupported operations567

Java 10/11 containers570

VectorEnumeration570

Hashtable571

Stack572

Bitset573

Summa575

Exercises576

12: The Javal/O System583

The File class584

A directo lister584

Checking for andcreating directories588

Input and output590

Types of InputStream591

Types of Outputstream593

Adding aributesand useful interfaces594

Reading from an InputStreamwith FilterInputStream595

Writing to an OutputStreamwith FilterOutputStream597

Readers Writers598

Sources and sinks of data599

Modifying stream behavior600

Unchanged Classes601

Off by itself:RandomAccessFile602

Typical usesof l/O streams603

Input streams605

Output streams608

Piped streams610

File reading writing utilities :610

Standard l/O612

Reading from standard input612

Changing Systemoutto a PrintWriter613

Redirecting standard l/O613

New l/O615

Converting data619

Fetching primitives623

View buffers625

Data manipulationwith buers630

Buffer details632

Memo-mapped les636

File locking640

Compression643

Simple compressionwith GZIP644

Multile storage with Zip645

Java ARchives (JARs)648

Object serialization650

Finding the class654

Controlling serialization656

Using persistence665

Preferences673

Regular expressions675

Creating regular expressions675

Quantifiers677

Paern and Matcher679

split( )688

Replace operations689

reset( )691

Regular expressionsand Java l/O692

Is StringTokenizer needed?693

Summary694

Exercises695

13: Concurrency699

Motivation700

Basic threads701

Yielding704

Sleeping705

Priority708

Daemon threads710

Joining a thread713

Coding variations715

Creating responsiveuser interfaces722

Sharinglimited resources723

Improperlyaccessing resources723

Colliding over resources729

Resolving sharedresource contention731

Critical sections738

Thread states744

Becoming blocked745

Cooperationbetween threads745

Wait and notify745

Using Pipes for l/Obetween threads750

Mo sophisticatedcooperation752

Deadlock752

The proper way to stop758

Interrupting ablocked thread759

Thread groups760

Summa761

Exercises762

14: CreatingWindows Applets765

The basic applet768

Applet restrictions768

Applet advantages769

Application frameworks770

Running applets insidea Web browser771

Using Appletuiewer773

Testing applets774

Running appletsfrom the command line775

A display framework777

Making a button779

Capturing an event780

Text areas783

Controlling layout785

BorderLayout786

FIowlayout787

Gridlayout788

GridBagLayout788

Absolute positioning789

BoxLayout789

The best approach?793

The Swing event model793

Event and listener types794

Tracking multiple events801

A catalog ofSwing components804

Buons805

Icons808

Tool tips810

Text elds810

Borders812

JScrolIPanes814

A mini-editor816

Check boxes817

Radio buttons819

Combo boxes(drop-down lists)820

List boxes821

Tabbed panes824

Message boxes825

Menus827

Pop-up menus834

Drawing835

Dialog Boxes838

File dialogs843

HTML on Swing components845

Sliders and progress bars846

Trees847

Tables850

Selecting Look Feel852

The clipboard854

Packaging an appletinto a JAR le857

Signing applets858

JNLP andJava Web Start863

Programmingtechniques869

Binding events dynamically870

Separating business logicfrom Ul logic872

A canonical form874

Concurrency Swing 875Runnable revisited875

Managing concurrency878

Visual programmingand JavaBeans882

What is a JavaBean?883

Extracting BeanInfowith the Introspector886

A more sophisticated Bean892

JavaBeansand synchronization896

Packaging a Bean 9otMore complex Bean suppo902

More to Beans903

Summa904

Exercises905

15: DiscoveringProblems909

Unit Testing911

A Simple Testing Framework913

JUnit925

Improving reliabilitywith assertions930

Asseion syntax931

Using Assertions forDesign by Contract934

Example: DBC +white-box unit testing938

Building with Ant944

Automate everything944

Problems with make945

Ant: the defacto standard946

Version control with CVS950

Daily builds953

Logging954

Logging Levels956

LogRecords959

Handlers961

Filters966

Formatters968

Example: Sending emailto report log messages969

Controlling Logging Levelsthrough Namespaces972

Logging Practicesfor Large Pjects974

Summa978

Debugging978

Debugging with JDB978

Graphical debuggers984

Proling and optimizing985

Trackingmemo consumption985

Tracking CPU usage986

Coverage testing986

JVM Profiling Interface986

Using HPROF987

Thread performance989

Optimization guidelines990

Doclets991

Summa993

Exercises995

16: Analysisand Design997

Methodology997

Phase o: Make a plan1000

The mission statement1000

Phase 1:What are we making?1001

Phase 2:How will we build it?1005

Five stages of object design1007

Guidelines forobject development1008

Phase 3: Build the Core 1009

Phase 4:Iterate the use cases1010

Phase 5: Evolution1010

Plans pay o1012

Extreme Programming1013

Write tests first1013

Pair programming1015

Strategies for transition1016

Guidelines1017

Management obstacles1018

Summary1020

A: Passing Returning Objects1021

Passing referencesaround1022

Aliasing1022

Making local copies1025

Pass by value1026

Cloning objects1026

Adding cloneabihtyto a class1028

Successful cloning1030

The effect ofObjectclone( )1032

Cloning a composed object1035

A deep copywith ArrayList1038

Deep copy via serialization1040

Adding cloneabilityfarther down a hierarchy1042

Why this strange design?1043

Controllingcloneability1044

The copy constructor1049

Read-only classes1054

Creating read-only classes1056

The drawbackto immutability1057

Immutable Strings1060

The String andStringBuer classes1063

Strings are special1067

Summa1067

Exercises1069

B: Java ProgrammingGuidelines1071

Design1071

Implementation1078

C: Supplements1085

Foundations for Javaseminar-on-CD1085

Thinking in Javaseminar1085

Hands-On Java seminar-on-CD 3rd edition1086

Designing Objects Systems seminar1086

Thinking inEnterprise Java1087

The J2EE seminar1088

Thinking in Paerns(with Java)1088

Thinking in Patternsseminar1089

Design consultingand reviews1089

D: Resources1091

Soware1091

Books1091

Analysis design1092

Python1095

My own list of books1095

Index1097

热门推荐