Java By Example

Java

By Example

Clayton Walnum

CONTENTS

Introduction

q Who This Book Is For q Hardware and Software Requirements q Compiling the Programs in This Book q A Word to the Wise q On to the Wonderful World of Java

Chapter 1 Java Overview

q The Java Story q Introducing Java q Java Programs q The Java Developer's Kit q Where Is Java? q Example: Installing HotJava q Example: Installing the JDK q Summary

q Review Questions q Review Exercises

Chapter 2 Running Java Applets

q The Sample Java Applets r The Appletviewer Tool r Example: Running TicTacToe r The Animator Applet r The BarChart Applet r Other Demo Applets

q Adding Applets to an HTML Document r Optional Attributes for Applets r Applet Parameters r Non-Java Browsers r Example: A Java-Powered Home Page

q Summary q Review Questions q Review Exercises

Chapter 3 Applets and the Internet

q Local and Remote Applets r Local Applets r Remote Applets

q Clients and Servers q Security q Example: Your Pages on the Web q Summary q Review Questions q Review Exercises

Chapter 4 Object-Oriented Programming Concepts

q From Switches to Objects q An Obvious, Yet Brilliant, Solution q Object-Oriented Programming

r Encapsulation r Classes as Data Types r Inheritance r Polymorphism r Example: Encapsulation, Inheritance, and Polymorphism q Summary q Review Questions q Review Exercises

Chapter 5 Constants and Variables

q Constants q Variables q Naming Constants and Variables q Example: Creating Your Own Identifiers q Data Types

r Integer Values r Floating-Point Values r Character Values r Boolean Values q Variable Scope r Example: Determining a Variable's Scope q Summary q Review Questions q Review Exercises

Chapter 6 Simple Input and Output

q Windows and Graphics q Displaying Text in an Applet

r Example: Creating and Running Applet1 r How Applet1 Works q Getting Input from the User r How Applet2 Works r Example: Retrieving text from a TextField control r How Applet3 Works q Displaying Numerical Values

q Summary q Review Questions q Review Exercises

Chapter 7 Math Operators

q The Addition Operator r Example: Using the Addition Operator r Example: Multiple Additions

q The Subtraction Operator r Example: Using the Subtraction Operator r Example: Multiple Subtractions Using Mixed Data Types r Example: Casting a Result to a Different Data Type

q The Multiplication Operator r Example: Multiplication and Data Types

q The Division Operator r Example: Integer Versus Floating-Point Division

q The Modulo Operator q The Increment Operator q The Decrement Operator q Example: Using Mathematical Calculations in an Applet

r How Applet5 Works q The Order of Operations

r Example: Order of Operations r Example: More Order of Operations r Example: Still More Order of Operations r Example: One Last Order of Operations q Summary q Review Questions q Review Exercises

Chapter 8 Expressions

q Types of Expressions q Expressions Within Expressions q Comparison Operators

r Example: Using Comparison Operators

q Logical Operators r Example: Using Logical Operators r Example: Using Multiple Logical Operators r Example: Combining Different Comparison and Logical Operators

q Writing Logical Expressions q Order of Operations q Summary q Review Questions q Review Exercises

Chapter 9 The if and switch Statements

q Controlling Program Flow q Program Flow and Branching q The if statement

r Example: The Form of an if Statement r Multiple if Statements r Multiple-Line if Statements r The else Clause r Example: Using the if Statement in a Program q The switch Statement r Example: Using the break Statement Correctly r Example: Using the switch Statement in a Program q Summary q Review Questions q Review Exercises

Chapter 10 The while and do-while Loops

q The while Loop r Example: Using a while Loop r Example: Using a while Loop in a Program

q The do-while Loop r Example: Using a do-while Loop r Example: Using a do-while Loop in a Program

q Summary q Review Questions

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download