Java: How to Program

Free Download

Authors:

Edition: 4th Edition

ISBN: 0130341517, 9780130341518

Size: 14 MB (14171760 bytes)

Pages: 1530/1530

File format:

Language:

Publishing Year:

Category: Tags: , ,

Deitel P. J.0130341517, 9780130341518

Written by the authors of the world’s best-selling introductory C and C++ texts, this state-of-the-art guide examines one of today’s hottest computer languages-Java; the first general-purpose, object-oriented language that is truly platform-independent. The latest Java 2 features are incorporated throughout this edition.

Table of contents :
Contents……Page 1
Preface……Page 13
Introduction to Computers, the Internet and the Web……Page 31
1. 1 Introduction……Page 32
1.3 Computer Organization……Page 37
1. 4 Evolution of Operating Systems……Page 38
1.5 Personal, Distributed and Client/ Server Computing……Page 39
Languages……Page 40
1. 7 History of C+ +……Page 41
1. 8 History of Java……Page 42
1.9 Java Class Libraries……Page 43
1. 11 Structured Programming……Page 44
1.12 The Internet and the World Wide Web……Page 45
1. 13 Basics of a Typical Java Environment……Page 46
1.14 General Notes about Java and This Book……Page 49
Technology and the Unified Modeling Language……Page 52
1. 16 Discovering Design Patterns: Introduction……Page 56
1. 17 Tour of the Book……Page 58
Design with the UML……Page 71
Sections……Page 75
Introduction to Java Applications……Page 85
2. 2 A First Program in Java: Printing a Line of Text……Page 86
2. 3 Modifying Our First Java Program……Page 92
2.4 Displaying Text in a Dialog Box……Page 95
2.5 Another Java Application: Adding Integers……Page 99
2. 6 Memory Concepts……Page 105
2. 7 Arithmetic……Page 106
2.8 Decision Making: Equality and Relational Operators……Page 109
the Problem Statement……Page 117
Introduction to Java Applets……Page 135
3. 1 Introduction……Page 136
3.2 Sample Applets from the Java 2 Software Development Kit……Page 137
3.3 A Simple Java Applet: Drawing a String……Page 142
3.4 Two More Simple Applets: Drawing Strings and Lines……Page 150
3. 5 Another Java Applet: Adding Floating- Point Numbers……Page 153
3.6 Viewing Applets in a Web Browser……Page 160
3.7 Java Applet Internet and World Wide Web Resources……Page 164
the Classes in a Problem Statement……Page 165
Control Structures: Part 1……Page 178
4. 2 Algorithms……Page 179
4. 4 Control Structures……Page 180
4. 5 The if Selection Structure……Page 183
4. 6 The if / else Selection Structure……Page 185
4. 7 The Repetition Structure……Page 189
Repetition)……Page 190
Refinement: Case Study 2 ( Sentinel- Controlled Repetition)……Page 195
Refinement: Case Study 3 ( Nested Control Structures)……Page 203
4. 11 Assignment Operators……Page 208
4. 12 Increment and Decrement Operators……Page 209
4. 13 Primitive Data Types……Page 212
Class Attributes……Page 213
Control Structures: Part 2……Page 227
5. 2 Essentials of Counter- Controlled Repetition……Page 228
5. 3 The Repetition Structure……Page 231
5. 4 Examples Using the for Structure……Page 235
5. 5 The switch Multiple- Selection Structure……Page 240
5. 6 The do / while Repetition Structure……Page 245
5. 7 Statements break and continue……Page 248
5.8 Labeled break and continue Statements……Page 250
5.9 Logical Operators……Page 252
5. 10 Structured Programming Summary……Page 259
Objects States and Activities……Page 264
Methods……Page 276
6.2 Program Modules in Java……Page 277
6. 4 Methods……Page 279
6. 5 Method Definitions……Page 281
6. 6 Argument Promotion……Page 288
6.7 Java API Packages……Page 289
6.8 Random- Number Generation……Page 291
6. 9 Example: A Game of Chance……Page 295
6. 10 Duration of Identifiers……Page 304
6. 11 Scope Rules……Page 305
6. 12 Recursion……Page 308
6.13 Example Using Recursion: The Fibonacci Series……Page 311
6. 14 Recursion vs. Iteration……Page 316
6. 15 Method Overloading……Page 318
6.16 Methods of Class JApplet……Page 321
Class Operations……Page 323
Arrays……Page 343
7. 1 Introduction……Page 344
7. 2 Arrays……Page 345
7. 4 Examples Using Arrays……Page 347
7.6 Passing Arrays to Methods……Page 359
7. 7 Sorting Arrays……Page 362
7.8 Searching Arrays: Linear Search and Binary Search……Page 365
7.9 Multiple- Subscripted Arrays……Page 373
Collaboration Among Objects……Page 380
Object- Based Programming……Page 408
8. 1 Introduction……Page 409
8.2 Implementing a Time Abstract Data Type with a Class……Page 410
8.4 Controlling Access to Members……Page 418
8.5 Creating Packages……Page 420
8. 6 Initializing Class Objects: Constructors……Page 424
8.7 Using Overloaded Constructors……Page 425
8. 8 Using Set and Get Methods……Page 430
8.9 Software Reusability……Page 441
8.10 Final Instance Variables……Page 442
Classes……Page 444
8. 12 Package Access……Page 447
8. 13 Using the Reference……Page 449
8. 14 Finalizers……Page 456
8. 15 Static Class Members……Page 457
8.16 Data Abstraction and Encapsulation……Page 462
Program the Classes for the Elevator Simulation……Page 464
Object- Oriented Programming……Page 475
9. 1 Introduction……Page 476
9.2 Superclasses and Subclasses……Page 479
9. 3 protected Members……Page 481
Objects……Page 482
9.5 Constructors and Finalizers in Subclasses……Page 489
Conversion……Page 493
9. 7 Software Engineering with Inheritance……Page 494
9. 9 Case Study: Point, Circle, Cylinder……Page 495
9. 10 Introduction to Polymorphism……Page 502
9. 12 Dynamic Method Binding……Page 503
9.14 Abstract Superclasses and Concrete Classes……Page 504
9. 15 Polymorphism Examples……Page 505
9. 16 Case Study: A Payroll System Using Polymorphism……Page 507
9.17 New Classes and Dynamic Binding……Page 515
9.18 Case Study: Inheriting Interface and Implementation……Page 516
9.19 Case Study: Creating and Using Interfaces……Page 524
9. 20 Inner Class Definitions……Page 531
9.21 Notes on Inner Class Definitions……Page 542
Incorporating Inheritance into the Elevator Simulation……Page 543
Creational, Structural and Behavioral Design Patterns……Page 550
Strings and Characters……Page 566
10. 1 Introduction……Page 567
10. 3 String Constructors……Page 568
10. 4 String Methods length , charAt and getChars……Page 570
10.5 Comparing String s……Page 572
10. 6 String Method hashCode……Page 577
10.7 Locating Characters and Substrings in String s……Page 579
10.8 Extracting Substrings from String s……Page 581
10. 9 Concatenating String s……Page 582
10. 10 Miscellaneous String Methods……Page 583
10. 11 Using String Method valueOf……Page 585
10. 12 String Method intern……Page 587
10. 13 StringBuffer Class……Page 589
10. 14 StringBuffer Constructors……Page 590
10. 15 StringBuffer Methods length , capacity ,……Page 591
10. 16 StringBuffer Methods charAt , setCharAt ,……Page 593
10. 17 StringBuffer append Methods……Page 594
10. 18 StringBuffer Insertion and Deletion Methods……Page 596
10. 19 Character Class Examples……Page 598
10. 20 Class StringTokenizer……Page 606
10.21 Card Shuffling and Dealing Simulation……Page 609
Handling……Page 613
Graphics and Java2D……Page 631
11. 1 Introduction……Page 632
11.2 Graphics Contexts and Graphics Objects……Page 634
11. 3 Color Control……Page 635
11. 4 Font Control……Page 642
11.5 Drawing Lines, Rectangles and Ovals……Page 648
11. 6 Drawing Arcs……Page 652
11. 7 Drawing Polygons and Polylines……Page 655
11.9 Java2D Shapes……Page 658
Designing Interfaces with the UML……Page 665
Graphical User Interface Components: Part 1……Page 676
12. 1 Introduction……Page 677
12. 2 Swing Overview……Page 679
12. 3 JLabel……Page 681
12.4 Event- Handling Model……Page 684
12. 5 JTextField and JPasswordField……Page 686
12. 6 JButton……Page 692
12. 7 JCheckBox and JRadioButton……Page 695
12. 8 JComboBox……Page 701
12. 9 JList……Page 703
12. 10 Multiple- Selection Lists……Page 706
12. 11 Mouse Event Handling……Page 708
12.12 Adapter Classes……Page 713
12. 13 Keyboard Event Handling……Page 719
12. 14 Layout Managers……Page 722
12. 15 Panels……Page 731
Cases……Page 733
Graphical User Interface Components: Part 2……Page 750
13. 1 Introduction……Page 751
13. 2 JTextArea……Page 752
13.3 Creating a Customized Subclass of JPanel……Page 755
13.4 Creating a Self- Contained Subclass of JPanel……Page 760
13. 5 JSlider……Page 765
13. 6 Windows……Page 769
Applications……Page 771
13. 8 Using Menus with Frames……Page 777
13. 9 Using JPopupMenus……Page 785
13.10 Pluggable Look- and- Feel……Page 788
13. 11 Using JDesktopPane and JInternalFrame……Page 792
13. 12 Layout Managers……Page 796
13. 13 BoxLayout Layout Manager……Page 797
13. 14 CardLayout Layout Manager……Page 800
13. 15 GridBagLayout Layout Manager……Page 804
13. 16 GridBagConstraints Constants RELATIVE and……Page 810
Controller……Page 813
Used in Packages java. awt and javax. swing……Page 818
Exception Handling……Page 834
14. 1 Introduction……Page 835
14. 3 Other Error- Handling Techniques……Page 837
14. 4 Basics of Java Exception Handling……Page 838
14.6 Throwing an Exception……Page 839
14.7 Catching an Exception……Page 840
14.8 Exception- Handling Example: Divide by Zero……Page 842
14. 10 throws Clause……Page 848
14. 12 Exceptions and Inheritance……Page 854
14. 13 finally Block……Page 855
14. 14 Using printStackTrace and getMessage……Page 860
Multithreading……Page 867
15. 1 Introduction……Page 868
15. 2 Class Thread : An Overview of the Thread Methods……Page 870
15.3 Thread States: Life Cycle of a Thread……Page 871
15.4 Thread Priorities and Thread Scheduling……Page 872
15.5 Thread Synchronization……Page 878
Synchronization……Page 879
Synchronization……Page 884
15. 8 Producer/ Consumer Relationship: The Circular Buffer……Page 890
15.9 Daemon Threads……Page 899
15. 10 Runnable Interface……Page 900
15. 11 Thread Groups……Page 906
Multithreading……Page 907
Design Patterns……Page 916
Files and Streams……Page 924
16.2 Data Hierarchy……Page 925
16.3 Files and Streams……Page 927
16.4 Creating a Sequential- Access File……Page 933
16.5 Reading Data from a Sequential- Access File……Page 945
16.6 Updating Sequential- Access Files……Page 957
16.8 Creating a Random- Access File……Page 958
16. 9 Writing Data Randomly to a Random- Access File……Page 963
16.10 Reading Data Sequentially from a Random- Access File……Page 969
16.11 Example: A Transaction- Processing Program……Page 974
16. 12 Class File……Page 991
Networking……Page 1008
17. 1 Introduction……Page 1009
17.2 Manipulating URIs……Page 1011
17.3 Reading a File on a Web Server……Page 1016
17.4 Establishing a Simple Server Using Stream Sockets……Page 1020
17.5 Establishing a Simple Client Using Stream Sockets……Page 1021
17. 6 Client/ Server Interaction with Stream Socket Connections……Page 1022
17. 7 Connectionless Client/ Server Interaction with Datagrams……Page 1033
17. 8 Client/ Server Tic- Tac- Toe Using a Multithreaded Server……Page 1041
17. 10 DeitelMessenger Chat Server and Client……Page 1056
Used in Packages java. io and java. net……Page 1086
Multimedia: Images, Animation, Audio and Video……Page 1098
18. 1 Introduction……Page 1099
18.2 Loading, Displaying and Scaling Images……Page 1100
18.3 Animating a Series of Images……Page 1103
18. 4 Customizing LogoAnimator via Applet Parameters……Page 1107
18.5 Image Maps……Page 1111
18.6 Loading and Playing Audio Clips……Page 1114
18.7 Internet and World Wide Web Resources……Page 1117
Data Structures……Page 1124
19. 1 Introduction……Page 1125
19. 3 Dynamic Memory Allocation……Page 1126
19.4 Linked Lists……Page 1127
19. 5 Stacks……Page 1138
19. 6 Queues……Page 1143
19. 7 Trees……Page 1146
Java Utilities Package and Bit Manipulation……Page 1177
20. 2 Vector Class and Enumeration Interface……Page 1178
20. 3 Stack Class……Page 1186
20. 4 Dictionary Class……Page 1190
20. 5 Hashtable Class……Page 1191
20. 6 Properties Class……Page 1198
20. 7 Random Class……Page 1204
20.8 Bit Manipulation and the Bitwise Operators……Page 1205
20. 9 BitSet Class……Page 1220
Collections……Page 1231
21. 1 Introduction……Page 1232
21. 3 Class……Page 1233
21. 5 Lists……Page 1238
21. 6 Algorithms……Page 1245
21. 7 Sets……Page 1253
21.8 Maps……Page 1256
21.10 Unmodifiable Wrappers……Page 1258
Used in Package java. util……Page 1259
Java Media Framework and Java Sound ( on CD)……Page 1266
22. 1 Introduction……Page 1267
22.2 Playing Media……Page 1268
22.3 Formatting and Saving Captured Media……Page 1279
22. 4 RTP Streaming……Page 1293
22.5 Java Sound……Page 1307
22. 6 Playing Sampled Audio……Page 1308
22.7 Musical Instrument Digital Interface ( MIDI)……Page 1315
22.8 Internet and World Wide Web Resources……Page 1346
and Sound in the View……Page 1347
A. 2 The Sites……Page 1376
B. 1 Resources……Page 1378
B. 2 Products……Page 1379
B. 6 Java Applets……Page 1380
B. 8 Newsgroups……Page 1381
C Operator Precedence Chart……Page 1383
D ASCII Character Set……Page 1385
E Number Systems ( on CD)……Page 1386
E. 1 Introduction……Page 1387
Hexadecimal Numbers……Page 1390
E. 4 Converting from Binary, Octal, or Hexadecimal to Decimal……Page 1391
E. 5 Converting from Decimal to Binary, Octal, or Hexadecimal……Page 1392
E. 6 Negative Binary Numbers: Two s Complement Notation……Page 1394
F Creating HTML Documentation with javadoc……Page 1399
F. 3 Documenting Java Source Code……Page 1400
F. 5 Files Produced by javadoc……Page 1409
G. 2 Events……Page 1414
G. 3 Listeners……Page 1418
G. 4 Component Diagrams Revisited……Page 1421
H. 2 Class ElevatorModel……Page 1423
H. 3 Classes Location and Floor……Page 1431
H. 4 Class Door……Page 1434
H. 5 Class Button……Page 1438
H. 6 Class ElevatorShaft……Page 1439
H. 7 Classes Light and Bell……Page 1446
H. 8 Class Elevator……Page 1450
H. 9 Class Person……Page 1459
H. 11 Conclusion……Page 1466
I. 1 Introduction……Page 1468
I. 2 Class Objects……Page 1485
I. 3 Class Constants……Page 1487
I. 4 Class constructor……Page 1488
I. 5 Event Handling……Page 1490
I. 7 Conclusion……Page 1493
J Career Opportunities ( on CD)……Page 1495
J. 1 Introduction……Page 1496
J. 2 Resources for the Job Seeker……Page 1497
J. 3 Online Opportunities for Employers……Page 1498
J. 4 Recruiting Services……Page 1503
J. 5 Career Sites……Page 1505
J. 6 Internet and World Wide Web Resources……Page 1511
K Unicode ® ( ( on CD)……Page 1519
K. 1 Introduction……Page 1520
K. 2 Unicode Transformation Formats……Page 1521
K. 3 Characters and Glyphs……Page 1522
K. 5 Unicode Consortium s Web Site……Page 1523
K. 6 Using Unicode……Page 1524
K. 7 Character Ranges……Page 1527

Reviews

There are no reviews yet.

Be the first to review “Java: How to Program”
Shopping Cart
Scroll to Top