teach yourself java in 21 days.pdf

(6710 KB) Pobierz
CONTENTS
CONTENTS
Teach Yourself
Java in 21 Days
Professional Reference Edition
by Laura Lemay, Charles L. Perkins and Michael Morrison
C O N T E N T S
Introduction
l
What Is Java?
l
Java's Past, Present, and Future
l
Why Learn Java?
Java Is Platform Independent
m
m
Java Is Object Oriented
m
Java Is Easy to Learn
l
Getting Started Programming in Java
Getting a Java Development Environment
m
m
Installing the JDK and Sample Files
m
Configuring the JDK
m
Creating a Java Application
m
Creating a Java Applet
l
Troubleshooting
l
Summary
l
Q&A
l
Thinking in Objects: An Analogy
l
Objects and Classes
l
Behavior and Attributes
file:///G|/ebooks/1575211831/index.htm (1 of 37) [11/06/2000 7:44:37 PM]
23043888.002.png
CONTENTS
m
Attributes
m
Behavior
m
Creating a Class
l
Inheritance, Interfaces, and Packages
Inheritance
m
m
Creating a Class Hierarchy
m
How Inheritance Works
m
Single and Multiple Inheritance
m
Interfaces and Packages
m
Creating a Subclass
l
Summary
l
Q&A
Day 3 Java Basics
l
Statements and Expressions
l
Variables and Data Types
Declaring Variables
m
m
Notes on Variable Names
m
Variable Types
m
Assigning Values to Variables
l
Comments
l
Literals
Number Literals
m
m
Boolean Literals
m
Character Literals
m
String Literals
l
Expressions and Operators
Arithmetic
m
m
More About Assignment
m
Incrementing and Decrementing
m
Comparisons
m
Logical Operators
m
Bitwise Operators
m
Operator Precedence
l
String Arithmetic
file:///G|/ebooks/1575211831/index.htm (2 of 37) [11/06/2000 7:44:37 PM]
23043888.003.png
CONTENTS
l
Summary
l
Q&A
l
Creating New Objects
Using new
m
m
What new Does
m
A Note on Memory Management
l
Accessing and Setting Class and Instance Variables
Getting Values
m
m
Changing Values
m
Class Variables
l
Calling Methods
Class Methods
m
l
References to Objects
l
Casting and Converting Objects and Primitive Types
Casting Primitive Types
m
m
Casting Objects
m
Converting Primitive Types to Objects and Vice Versa
l
Odds and Ends
Comparing Objects
m
m
Determining the Class of an Object
l
Class and Object Reflection (Java 1.1)
l
The Java Class Library
l
Summary
l
Q&A
l
Arrays
Declaring Array Variables
m
m
Creating Array Objects
m
Accessing Array Elements
m
Changing Array Elements
m
Multidimensional Arrays
file:///G|/ebooks/1575211831/index.htm (3 of 37) [11/06/2000 7:44:37 PM]
23043888.004.png
CONTENTS
l
Block Statements
l
if Conditionals
The Conditional Operator
m
l
switch Conditionals
l
for Loops
l
while and do Loops
while Loops
m
m
do...while Loops
l
Breaking Out of Loops
Labeled Loops
m
l
Summary
l
Q&A
l
Defining Classes
l
Creating Instance and Class Variables
Defining Instance Variables
m
m
Constants
m
Class Variables
l
Creating Methods
Defining Methods
m
m
The this Keyword
m
Variable Scope and Method Definitions
m
Passing Arguments to Methods
m
Class Methods
l
Creating Java Applications
Helper Classes
m
l
Java Applications and Command-Line Arguments
Passing Arguments to Java Programs
m
m
Handling Arguments in Your Java Program
l
Summary
l
Q&A
file:///G|/ebooks/1575211831/index.htm (4 of 37) [11/06/2000 7:44:37 PM]
23043888.005.png
CONTENTS
l
Creating Methods with the Same Name, Different Arguments
l
Constructor Methods
Basic Constructors
m
m
Calling Another Constructor
m
Overloading Constructors
l
Overriding Methods
Creating Methods That Override Existing Methods
m
m
Calling the Original Method
m
Overriding Constructors
l
Finalizer Methods
l
Summary
l
Q&A
l
How Applets and Applications Are Different
l
Creating Applets
Major Applet Activities
m
m
A Simple Applet
l
Including an Applet on a Web Page
The <APPLET> Tag
m
m
Testing the Result
m
Making Java Applets Available to the Web
l
More About the <APPLET> Tag
ALIGN
m
m
HSPACE and VSPACE
m
CODE and CODEBASE
l
Java Archives
l
Passing Parameters to Applets
l
Summary
l
Q&A
file:///G|/ebooks/1575211831/index.htm (5 of 37) [11/06/2000 7:44:37 PM]
23043888.001.png
Zgłoś jeśli naruszono regulamin