وبلاگ بلیان

Introduction to Java Programming, Brief (8th Edition)

معرفی کتاب «Introduction to Java Programming, Brief (8th Edition)» نوشتهٔ Y. Daniel Liang، منتشرشده توسط نشر Pearson/Prentice Hall در سال 2010. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است. «Introduction to Java Programming, Brief (8th Edition)» در دستهٔ بدون دسته‌بندی قرار دارد.

__Introduction to Java Programming, Brief, 8e__ consists of the first 20 chapters from the Comprehensive version of __Introduction to Java Programming__. It introduces fundamentals of programming, problem-solving, object-oriented programming, and GUI programming. The Brief version is suitable for a CS1 course. Regardless of major, students will be able to grasp concepts of problem-solving and programming — thanks to Liang’s fundamentals-first approach, students learn critical problem solving skills and core constructs before object-oriented programming. Liang’s approach includes application-rich programming examples, which go beyond the traditional math-based problems found in most texts. Students are introduced to topics like control statements, methods, and arrays before learning to create classes. Later chapters introduce advanced topics including graphical user interface, exception handling, I/O, and data structures. Small, simple examples demonstrate concepts and techniques while longer examples are presented in case studies with overall discussions and thorough line-by-line explanations. In the Eighth Edition, only standard classes are used. Cover 1 Title Page 4 Copyright 5 CONTENTS 17 Chapter 1 Introduction to Computers, Programs, and Java 26 1.1 Introduction 27 1.2 What Is a Computer? 27 1.3 Programs 30 1.4 Operating Systems 32 1.5 Java, World Wide Web, and Beyond 33 1.6 The Java Language Specification, API, JDK, and IDE 35 1.7 A Simple Java Program 36 1.8 Creating, Compiling, and Executing a Java Program 38 1.9 (GUI) Displaying Text in a Message Dialog Box 41 Chapter 2 Elementary Programming 48 2.1 Introduction 49 2.2 Writing Simple Programs 49 2.3 Reading Input from the Console 51 2.4 Identifiers 54 2.5 Variables 54 2.6 Assignment Statements and Assignment Expressions 55 2.7 Named Constants 56 2.8 Numeric Data Types and Operations 57 2.9 Problem: Displaying the Current Time 62 2.10 Shorthand Operators 64 2.11 Numeric Type Conversions 66 2.12 Problem: Computing Loan Payments 68 2.13 Character Data Type and Operations 69 2.14 Problem: Counting Monetary Units 72 2.15 The String Type 75 2.16 Programming Style and Documentation 76 2.17 Programming Errors 78 2.18 (GUI) Getting Input from Input Dialogs 80 Chapter 3 Selections 96 3.1 Introduction 97 3.2 boolean Data Type 97 3.3 Problem: A Simple Math Learning Tool 98 3.4 if Statements 99 3.5 Problem: Guessing Birthdays 100 3.6 Two-Way if Statements 104 3.7 Nested if Statements 105 3.8 Common Errors in Selection Statements 106 3.9 Problem: An Improved Math Learning Tool 107 3.10 Problem: Computing Body Mass Index 109 3.11 Problem: Computing Taxes 110 3.12 Logical Operators 113 3.13 Problem: Determining Leap Year 115 3.14 Problem: Lottery 116 3.15 switch Statements 118 3.16 Conditional Expressions 120 3.17 Formatting Console Output 120 3.18 Operator Precedence and Associativity 122 3.19 (GUI) Confirmation Dialogs 123 Chapter 4 Loops 140 4.1 Introduction 141 4.2 The while Loop 141 4.3 The do-while Loop 149 4.4 The for Loop 151 4.5 Which Loop to Use? 153 4.6 Nested Loops 154 4.7 Minimizing Numeric Errors 155 4.8 Case Studies 156 4.9 Keywords break and continue 160 4.10 (GUI) Controlling a Loop with a Confirmation Dialog 164 Chapter 5 Methods 180 5.1 Introduction 181 5.2 Defining a Method 181 5.3 Calling a Method 183 5.4 void Method Example 185 5.5 Passing Parameters by Values 187 5.6 Modularizing Code 190 5.7 Problem: Converting Decimals to Hexadecimals 192 5.8 Overloading Methods 193 5.9 The Scope of Variables 196 5.10 The Math Class 197 5.11 Case Study: Generating Random Characters 200 5.12 Method Abstraction and Stepwise Refinement 201 Chapter 6 Single-Dimensional Arrays 222 6.1 Introduction 223 6.2 Array Basics 223 6.3 Problem: Lotto Numbers 229 6.4 Problem: Deck of Cards 231 6.5 Copying Arrays 233 6.6 Passing Arrays to Methods 234 6.7 Returning an Array from a Method 237 6.8 Variable-Length Argument Lists 240 6.9 Searching Arrays 241 6.10 Sorting Arrays 244 6.11 The Arrays Class 248 Chapter 7 Multidimensional Arrays 260 7.1 Introduction 261 7.2 Two-Dimensional Array Basics 261 7.3 Processing Two-Dimensional Arrays 263 7.4 Passing Two-Dimensional Arrays to Methods 265 7.5 Problem: Grading a Multiple-Choice Test 266 7.6 Problem: Finding a Closest Pair 267 7.7 Problem: Sudoku 269 7.8 Multidimensional Arrays 273 Chapter 8 Objects and Classes 288 8.1 Introduction 289 8.2 Defining Classes for Objects 289 8.3 Example: Defining Classes and Creating Objects 291 8.4 Constructing Objects Using Constructors 295 8.5 Accessing Objects via Reference Variables 295 8.6 Using Classes from the Java Library 299 8.7 Static Variables, Constants, and Methods 303 8.8 Visibility Modifiers 307 8.9 Data Field Encapsulation 308 8.10 Passing Objects to Methods 311 8.11 Array of Objects 312 Chapter 9 Strings and Text I/O 326 9.1 Introduction 327 9.2 The String Class 327 9.3 The Character Class 338 9.4 The StringBuilder/StringBuffer Class 340 9.5 Command-Line Arguments 345 9.6 The File Class 347 9.7 File Input and Output 350 9.8 (GUI) File Dialogs 354 Chapter 10 Thinking in Objects 368 10.1 Introduction 369 10.2 Immutable Objects and Classes 369 10.3 The Scope of Variables 370 10.4 The this Reference 371 10.5 Class Abstraction and Encapsulation 372 10.6 Object-Oriented Thinking 376 10.7 Object Composition 378 10.8 Designing the Course Class 380 10.9 Designing a Class for Stacks 382 10.10 Designing the GuessDate Class 384 10.11 Class Design Guidelines 387 Chapter 11 Inheritance and Polymorphism 398 11.1 Introduction 399 11.2 Superclasses and Subclasses 399 11.3 Using the super Keyword 405 11.4 Overriding Methods 407 11.5 Overriding vs. Overloading 408 11.6 The Object Class and Its toString() Method 409 11.7 Polymorphism 409 11.8 Dynamic Binding 410 11.9 Casting Objects and the instanceof Operator 412 11.10 The Object’s equals() Method 414 11.11 The ArrayList Class 415 11.12 A Custom Stack Class 418 11.13 The protected Data and Methods 419 11.14 Preventing Extending and Overriding 421 Chapter 12 GUI Basics 430 12.1 Introduction 431 12.2 Swing vs. AWT 431 12.3 The Java GUI API 431 12.4 Frames 433 12.5 Layout Managers 436 12.6 Using Panels as Subcontainers 442 12.7 The Color Class 444 12.8 The Font Class 444 12.9 Common Features of Swing GUI Components 445 12.10 Image Icons 447 Chapter 13 Exception Handling 456 13.1 Introduction 457 13.2 Exception-Handling Overview 457 13.3 Exception-Handling Advantages 459 13.4 Exception Types 462 13.5 More on Exception Handling 464 13.6 The finally Clause 470 13.7 When to Use Exceptions 472 13.8 Rethrowing Exceptions 472 13.9 Chained Exceptions 472 13.10 Creating Custom Exception Classes 473 Chapter 14 Abstract Classes and Interfaces 482 14.1 Introduction 483 14.2 Abstract Classes 483 14.3 Example: Calendar and GregorianCalendar 487 14.4 Interfaces 490 14.5 Example: The Comparable Interface 492 14.6 Example: The ActionListener Interface 494 14.7 Example: The Cloneable Interface 496 14.8 Interfaces vs. Abstract Classes 498 14.9 Processing Primitive Data Type Values as Objects 501 14.10 Sorting an Array of Objects 504 14.11 Automatic Conversion between Primitive Types and Wrapper Class Types 506 14.12 The BigInteger and BigDecimal Classes 506 14.13 Case Study: The Rational Class 507 Chapter 15 Graphics 522 15.1 Introduction 523 15.2 Graphical Coordinate Systems 523 15.3 The Graphics Class 524 15.4 Drawing Strings, Lines, Rectangles, and Ovals 526 15.5 Case Study: The FigurePanel Class 527 15.6 Drawing Arcs 531 15.7 Drawing Polygons and Polylines 532 15.8 Centering a String Using the FontMetrics Class 535 15.9 Case Study: The MessagePanel Class 537 15.10 Case Study: The StillClock Class 541 15.11 Displaying Images 545 15.12 Case Study: The ImageViewer Class 547 Chapter 16 Event-Driven Programming 558 16.1 Introduction 559 16.2 Event and Event Source 559 16.3 Listeners, Registrations, and Handling Events 560 16.4 Inner Classes 566 16.5 Anonymous Class Listeners 567 16.6 Alternative Ways of Defining Listener Classes 569 16.7 Problem: Loan Calculator 572 16.8 Window Events 574 16.9 Listener Interface Adapters 576 16.10 Mouse Events 577 16.11 Key Events 580 16.12 Animation Using the Timer Class 582 Chapter 17 Creating Graphical User Interfaces 596 17.1 Introduction 597 17.2 Buttons 597 17.3 Check Boxes 603 17.4 Radio Buttons 606 17.5 Labels 608 17.6 Text Fields 609 17.7 Text Areas 611 17.8 Combo Boxes 615 17.9 Lists 618 17.10 Scroll Bars 621 17.11 Sliders 624 17.12 Creating Multiple Windows 627 Chapter 18 Applets and Multimedia 638 18.1 Introduction 639 18.2 Developing Applets 639 18.3 The HTML File and the Tag 640 18.4 Applet Security Restrictions 643 18.5 Enabling Applets to Run as Applications 643 18.6 Applet Life-Cycle Methods 645 18.7 Passing Strings to Applets 645 18.8 Case Study: Bouncing Ball 649 18.9 Case Study: TicTacToe 653 18.10 Locating Resources Using the URL Class 657 18.11 Playing Audio in Any Java Program 658 18.12 Case Study: Multimedia Animations 659 Chapter 19 Binary I/O 674 19.1 Introduction 675 19.2 How is I/O Handled in Java? 675 19.3 Text I/O vs. Binary I/O 675 19.4 Binary I/O Classes 677 19.5 Problem: Copying Files 685 19.6 Object I/O 687 19.7 Random-Access Files 691 Chapter 20 Recursion 702 20.1 Introduction 703 20.2 Problem: Computing Factorials 703 20.3 Problem: Computing Fibonacci Numbers 706 20.4 Problem Solving Using Recursion 708 20.5 Recursive Helper Methods 709 20.6 Problem: Finding the Directory Size 712 20.7 Problem: Towers of Hanoi 713 20.8 Problem: Fractals 717 20.9 Problem: Eight Queens 720 20.10 Recursion vs. Iteration 722 20.11 Tail Recursion 722 APPENDIXES 732 Appendix A: Java Keywords 734 Appendix B: The ASCII Character Set 735 Appendix C: Operator Precedence Chart 737 Appendix D: Java Modifiers 739 Appendix E: Special Floating-Point Values 741 Appendix F: Number Systems 742 INDEX 746 A 746 B 747 C 747 D 748 E 748 F 749 G 749 H 750 I 750 J 750 K 751 L 751 M 751 N 752 O 752 P 753 Q 753 R 753 S 754 T 755 U 755 V 756 W 756 X 756 Y 756 Z 756
دانلود کتاب Introduction to Java Programming, Brief (8th Edition)