ebook img

Java Illuminated: An Active Learning Approach PDF

1273 Pages·2014·48.15 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Java Illuminated: An Active Learning Approach

World Headquarters Jones & Bartlett Learning 5 Wall Street Burlington, MA 01803 978-443-5000 [email protected] www.jblearning.com Jones & Bartlett Learning books and products are available through most bookstores and online booksellers. To contact Jones & Bartlett Learning directly, call 800-832-0034, fax 978-443-8000, or visit our website, www.jblearning.com. Substantial discounts on bulk quantities of Jones & Bartlett Learning publications are available to corporations, professional associations, and other qualified organizations. For details and specific discount information, contact the special sales department at Jones & Bartlett Learning via the above contact information or send an email to [email protected]. Copyright © 2016 by Jones & Bartlett Learning, LLC, an Ascend Learning Company All rights reserved. No part of the material protected by this copyright may be reproduced or utilized in any form, electronic or mechanical, including photocopying, recording, or by any information storage and retrieval system, without written permission from the copyright owner. The content, statements, views, and opinions herein are the sole expression of the respective authors and not that of Jones & Bartlett Learning, LLC. Reference herein to any specific commercial product, process, or service by trade name, trademark, manufacturer, or otherwise does not constitute or imply its endorsement or recommendation by Jones & Bartlett Learning, LLC and such reference shall not be used for advertising or product endorsement purposes. All trademarks displayed are the trademarks of the parties noted herein. Java Illuminated, Fourth Edition, is an independent publication and has not been authorized, sponsored, or otherwise approved by the owners of the trademarks or service marks referenced in this product. There may be images in this book that feature models; these models do not necessarily endorse, represent, or participate in the activities represented in the images. Any screenshots in this product are for educational and instructive purposes only. Any individuals and scenarios featured in the case studies throughout this product may be real or fictitious, but are used for instructional purposes only. 05782-9 Production Credits Executive Publisher: William Brottmiller Publisher: Cathy L. Esperti Acquisitions Editor: Laura Pagluica Associate Production Editor: Sara Kelly Associate Marketing Manager: Cassandra Peterson VP, Manufacturing and Inventory Control: Therese Connell Composition: diacriTech Cover & Title Page Design: Scott Moden Rights and Photo Research Coordinator: Ashley Dos Santos Cover & Title Page Image: © Kyle Smith/ShutterStock, Inc. Printing and Binding: Courier Companies Cover Printing: Courier Companies Library of Congress Cataloging-in-Publication Data Anderson, Julie, 1947– Java illuminated / Julie Anderson, Rollins College, Hervé J. Franceschi, Capitol College. — Fourth edition. pages cm Includes bibliographical references and index. ISBN 978-1-284-04531-4 (pbk.) 1. Java (Computer program language) I. Franceschi, Hervé. II. Title. QA76.73.J3A533 2015 005.13’3—dc23 2014024734 6048 Printed in the United States of America 18 17 16 15 14 10 9 8 7 6 5 4 3 2 1 Dedications To the memory of my parents, Glenn and Rosemary Austin, my first teachers. – Julie Anderson A ma mère, trop tôt disparue, et à mon père. – Hervé Franceschi Contents Preface Turing’s Craft CodeLab Student Registration Instructions Acknowledgments Chapter 1 Introduction to Programming and the Java Language 1.1 Basic Computer Concepts 1.1.1 Hardware 1.1.2 Operating Systems 1.1.3 Application Software 1.1.4 Computer Networks and the Internet 1.2 Practice Activity: Displaying System Configuration 1.2.1 Displaying Windows Configuration Information 1.2.2 Displaying Mac OS Configuration Information 1.3 Data Representation 1.3.1 Binary Numbers 1.3.2 Using Hexadecimal Numbers to Represent Binary Numbers 1.3.3 Representing Characters with the Unicode Character Set 1.4 Programming Languages 1.4.1 High- and Low-Level Languages 1.4.2 An Introduction to Object-Oriented Programming 1.4.3 The Java Language 1.5 An Introduction to Programming 1.5.1 Programming Basics 1.5.2 Program Design with Pseudocode 1.5.3 Developing a Java Application 1.5.4 Programming Activity 1: Writing a First Java Application Debugging Techniques Testing Techniques 1.6 Chapter Summary 1.7 Exercises, Problems, and Projects Chapter 2 Programming Building Blocks—Java Basics 2.1 Java Application Structure 2.2 Data Types, Variables, and Constants 2.2.1 Declaring Variables 2.2.2 Integer Data Types 2.2.3 Floating-Point Data Types 2.2.4 Character Data Type 2.2.5 Boolean Data Type 2.2.6 The Assignment Operator, Initial Values, and Literals 2.2.7 String Literals and Escape Sequences 2.2.8 Constants 2.3 Expressions and Arithmetic Operators 2.3.1 The Assignment Operator and Expressions 2.3.2 Arithmetic Operators 2.3.3 Operator Precedence 2.3.4 Programming Activity 1: Converting Inches to Centimeters 2.3.5 Integer Division and Modulus 2.3.6 Division by Zero 2.3.7 Mixed-Type Arithmetic and Type Casting 2.3.8 Shortcut Operators 2.4 Programming Activity 2: Temperature Conversion 2.5 Chapter Summary 2.6 Exercises, Problems, and Projects Chapter 3 Object-Oriented Programming, Part 1: Using Classes 3.1 Class Basics and Benefits 3.2 Creating Objects Using Constructors 3.3 Calling Methods 3.4 Using Object References 3.5 Programming Activity 1: Calling Methods 3.6 The Java Class Library 3.7 The String Class The length Method The toUpperCase and toLowerCase Methods The indexOf Methods The charAt and substring Methods 3.8 Formatting Output with the DecimalFormat Class 3.9 Generating Random Numbers with the Random Class 3.10 Input from the Console Using the Scanner Class 3.11 Calling Static Methods and Using Static Class Variables 3.12 Using System.in and System.out 3.13 The Math Class The pow Method The round Method The min and max Methods 3.14 Formatting Output with the NumberFormat Class 3.15 The Integer, Double, and Other Wrapper Classes 3.16 Input and Output Using JOptionPane Dialog Boxes 3.17 Programming Activity 2: Using Predefined Classes 3.18 Chapter Summary 3.19 Exercises, Problems, and Projects Chapter 4 Introduction to Applets and Graphical Applications 4.1 Applet Structure 4.2 Executing an Applet 4.3 Drawing Shapes with Graphics Methods 4.4 Using Color 4.5 Programming Activity 1: Writing an Applet with Graphics 4.6 Graphical Applications 4.7 Chapter Summary 4.8 Exercises, Problems, and Projects Chapter 5 Flow of Control, Part 1: Selection 5.1 Forming Conditions 5.1.1 Equality Operators 5.1.2 Relational Operators 5.1.3 Logical Operators DeMorgan’s Laws 5.2 Simple Selection with if 5.3 Selection Using if/else Block Scope 5.4 Selection Using if/else if 5.5 Sequential and Nested if/else Statements 5.5.1 Sequential if/else Statements Finding the Minimum or Maximum Values 5.5.2 Nested if/else Statements Dangling else 5.6 Testing Techniques for if/else Statements 5.7 Programming Activity 1: Working with if/else 5.8 Comparing Floating-Point Numbers 5.9 Comparing Objects 5.9.1 The equals Method 5.9.2 String Comparison Methods 5.10 The Conditional Operator (?:) 5.11 The switch Statement 5.12 Programming Activity 2: Using the switch Statement 5.13 Chapter Summary 5.14 Exercises, Problems, and Projects Chapter 6 Flow of Control, Part 2: Looping 6.1 Event-Controlled Loops Using while 6.2 General Form for while Loops 6.3 Event-Controlled Looping 6.3.1 Reading Data from the User 6.3.2 Reading Data from a Text File 6.4 Looping Techniques 6.4.1 Accumulation 6.4.2 Counting Items 6.4.3 Calculating an Average 6.4.4 Finding Maximum or Minimum Values 6.4.5 Animation 6.5 Type-Safe Input Using Scanner 6.6 Constructing Loop Conditions 6.7 Testing Techniques for while Loops 6.8 Event-Controlled Loops Using do/while 6.9 Programming Activity 1: Using while Loops Task Instructions Troubleshooting 6.10 Count-Controlled Loops Using for 6.10.1 Basic Structure of for Loops 6.10.2 Constructing for Loops 6.10.3 Testing Techniques for for Loops 6.11 Nested Loops 6.12 Programming Activity 2: Using for Loops Instructions Troubleshooting 6.13 Chapter Summary 6.14 Exercises, Problems, and Projects Chapter 7 Object-Oriented Programming, Part 2: User-Defined Classes 7.1 Defining a Class 7.2 Defining Instance Variables 7.3 Writing Class Methods 7.4 Writing Constructors 7.5 Writing Accessor Methods 7.6 Writing Mutator Methods 7.7 Writing Data Manipulation Methods 7.8 Programming Activity 1: Writing a Class Definition, Part 1 7.9 The Object Reference this 7.10 The toString and equals Methods 7.11 Static Class Members 7.12 Graphical Objects 7.13 Enumeration Types 7.14 Programming Activity 2: Writing a Class Definition, Part 2 7.15 Creating Packages 7.16 Generating Web-Style Documentation with Javadoc 7.17 Chapter Summary 7.18 Exercises, Problems, and Projects Chapter 8 Single-Dimensional Arrays 8.1 Declaring and Instantiating Arrays 8.1.1 Declaring Arrays 8.1.2 Instantiating Arrays 8.1.3 Combining the Declaration and Instantiation of Arrays 8.1.4 Assigning Initial Values to Arrays 8.2 Accessing Array Elements 8.3 Aggregate Array Operations 8.3.1 Printing Array Elements

Description:
Each new print copy includes Navigate 2 Advantage Access that unlocks a comprehensive and interactive eBook, student practice activities and assessments, a full suite of instructor resources, and learning analytics reporting tools. Fully revised and updated to reflect the most recent features in Jav
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.