- ホーム
- > 洋書
Full Description
For introductory Computer Science courses using Java, and other introductory programming courses in departments of Computer Science, Computer Engineering, CIS, MIS, IT, and Business. Students are introduced to object-oriented programming and important concepts such as design, testing and debugging, programming style, interfaces inheritance, and exception handling. The Java coverage is a concise, accessible introduction that covers key language features. Objects are covered thoroughly and early in the text, with an emphasis on application programs over applets. Updated for Java 7, the Sixth Edition contains additional programming projects, case studies, and VideoNotes. MyProgrammingLab, Pearson's new online homework and assessment tool, is available with this edition.
Contents
Chapter 1 Introduction to Computers and Java 11.1 Computer Basics 2Hardware and Memory 3Programs 6Programming Languages, Compilers, and Interpreters 7Java Bytecode 9Class Loader 111.2 A Sip of Java 12History of the Java Language 12Applications and Applets 13A First Java Application Program 14Writing, Compiling, and Running a Java Program 191.3 Programming Basics 21Object-Oriented Programming 21Algorithms 25Testing and Debugging 27Software Reuse 281.4 Graphics Supplement 30A Sample Graphics Applet 30Size and Position of Figures 32Drawing Ovals and Circles 34Drawing Arcs 35Running an Applet 37Chapter 2 Basic Computation 472.1 Variables and Expressions 48Variables 49Data Types 51Java Identifiers 53Assignment Statements 55Simple Input 58Simple Screen Output 60Constants 60Named Constants 62Assignment Compatibilities 63Type Casting 65Arithmetic Operators 68Parentheses and Precedence Rules 71Specialized Assignment Operators 72Case Study: Vending Machine Change 74Increment and Decrement Operators 79More About the Increment and Decrement Operators 802.2 The Class String 81String Constants and Variables 81Concatenation of Strings 82String Methods 83String Processing 85Escape Characters 88The Unicode Character Set 892.3 Keyboard and Screen I/O 91Screen Output 91Keyboard Input 94Other Input Delimiters (Optional) 99Formatted Output with printf (Optional) 1012.4 Documentation and Style 103Meaningful Variable Names 103Comments 104Indentation 107Using Named Constants 1072.5 Graphics Supplement 109Style Rules Applied to a Graphics Applet 110Creating a Java GUI Application with the JFrame Class 110Introducing the Class JOptionPane 113Reading Input as Other Numeric Types 123Programming Example: Change-Making Programwith Windowing I/O 124Chapter 3 Flow of Control: Branching 1373.1 The if-else Statement 138The Basic if-else Statement 139Boolean Expressions 145Comparing Strings 150Nested if-else Statements 155Multibranch if-else Statements 157Programming Example: Assigning Letter Grades 159Case Study: Body Mass Index 162The Conditional Operator (Optional) 165The exit Method 1653.2 The Type boolean 166Boolean Variables 167Precedence Rules 168Input and Output of Boolean Values 1713.3 The switch Statement 173Enumerations 1793.4 Graphics Supplement 180Specifying a Drawing Color 181A Dialog Box for a Yes-or-No Question 184Chapter 4 Flow of Control: Loops 1954.1 Java Loop Statements 196The while Statement 197The do-while Statement 200Programming Example: Bug Infestation 205Programming Example: Nested Loops 211The for Statement 213Declaring Variables within a for Statement 219Using a Comma in a for Statement (Optional) 220The for-each Statement 2224.2 Programming with Loops 222The Loop Body 223Initializing Statements 224Controlling the Number of Loop Iterations 225Case Study: Using a Boolean Variable to End a Loop 227Programming Example: Spending Spree 229The break Statement and continue Statement in Loops(Optional) 232Loop Bugs 235Tracing Variables 237Assertion Checks 2394.3 Graphics Supplement 241Programming Example: A Multiface Applet 241The drawstring Method 247Chapter 5 Defining Classes and Methods 2615.1 Class and Method Definitions 263Class Files and Separate Compilation 265Programming Example: Implementing a Dog Class 265Instance Variables 266Methods 269Defining void Methods 272Defining Met



