Object-Oriented Programming With Java / Edition 2

Object-Oriented Programming With Java / Edition 2

by Barry Holmes, Daniel T. Joyce
     
 

ISBN-10: 0763714356

ISBN-13: 9780763714352

Pub. Date: 10/04/2000

Publisher: Jones & Bartlett Learning

Object-Oriented Programming with Java was developed for students in the science, engineering, and business fields where knowledge of programming is thought to be essential. This text, on modern software development, contains material that is typically covered in a CS1 course. In addition to traditional introductory programming concepts, object-oriented concepts and

Overview

Object-Oriented Programming with Java was developed for students in the science, engineering, and business fields where knowledge of programming is thought to be essential. This text, on modern software development, contains material that is typically covered in a CS1 course. In addition to traditional introductory programming concepts, object-oriented concepts and techniques such as inheritance and polymorphism are presented in a student-friendly manner. Java-related topics such as exception handling and the Java I/O models are carefully treated, and an entire chapter is devoted to Java applets.

Product Details

ISBN-13:
9780763714352
Publisher:
Jones & Bartlett Learning
Publication date:
10/04/2000
Edition description:
2E
Pages:
608
Product dimensions:
7.44(w) x 9.26(h) x 1.15(d)

Table of Contents

Chapter 0Introduction1
0.1What is Java?2
0.2Using the Internet3
0.3Downloading the Java 2 SDK for Windows, Unix (Solaris), and Linux Users4
0.4Downloading Java 2 SDK Documentation4
0.5Creating a Java Software Development Environment5
0.6Copying and Installing the Audio-Visual Interface (AVI)7
0.7How to Input and Save a Java Program in the Computer9
0.8How to Compile a Java Program10
0.9How to Execute (run) a Java Program12
0.10SDK Tools14
0.11Copying and Editing Programs from the CD15
Summary17
Chapter 1Primitive Data Types and Arithmetic19
1.1Data20
1.2Data Storage21
Number Systems23
1.3Identifiers27
1.4Syntax29
1.5Variables and Constants31
1.6The Format of a Simple Program33
1.7Arithmetic35
Unary Operators35
Binary Multiplicative Operators35
Binary Additive Operators35
1.8Operator Precedence40
1.9Casting42
Summary45
Review Questions46
Exercises47
Programming Problems49
Chapter 2Objects51
2.1Introduction to Objects52
2.2The String Class53
Declaring Objects54
Methods and Parameters54
Constructors56
String Assignment58
Instance Methods58
2.3The Anatomy of a Simple Program Revisited61
Heading Giving Details of the Name and Purpose of the Program62
Import List62
Class Name63
Main Method63
2.4The AVI Package63
2.5The Window Class65
2.6Input to a Dialog Box69
2.7Converting Strings to Numbers72
2.8Command Line Arguments75
2.9Errors78
Syntax Errors78
Run-Time Errors82
Logical Errors82
Summary82
Review Questions83
Exercises84
Programming Problems85
Chapter 3Object-Oriented Programming87
3.1Abstract Data Type88
3.2Constructors90
3.3Instance Methods93
3.4Class Methods101
3.5Scope and Lifetime of Identifiers104
3.6Software Development106
3.7Object-Oriented Program Design108
Identify the Classes and Methods109
Algorithm Development111
Testing112
Compilation and Execution112
Documentation113
Case Study: Cutting Logs116
3.8The AVI Package Revisited124
The Audio Class125
The Timer Class128
The Filmstrip Class130
Case Study: A Simulation of Rolling a Die135
Summary144
Review Questions146
Exercises147
Programming Problems150
Chapter 4Selection153
4.1More AVI Classes154
The Slider Class154
The RadioButtons Class156
4.2If..else Statement161
4.3Nested If Statement166
4.4Conditional Expressions172
4.5Else if Statements176
4.6Boolean Data Type177
4.7Switch179
4.8Wrapper Classes184
Case Study: Body Mass Index185
4.9Yet another AVI Class!194
The Memo Class194
4.10The This Object195
Case Study: Validation of Dates including Leap Years196
Summary209
Review Questions210
Exercises210
Programming Problems212
Chapter 5Repetition and One-Dimensional Arrays217
5.1Loop Structure218
5.2While Loop220
While Loop Controlled by a Counter220
While Loop Controlled by Data220
5.3Do..while Loop227
5.4Increment/Decrement Operators232
5.5For Loop235
5.6Which Loop?239
while240
do..while240
for240
5.7Arrays Revisited241
5.8Declaring and Initializing One-Dimensional Arrays242
Three Methods242
5.9Using Arrays245
Case Study: Palindrome253
5.10Our Last AVI Class: CheckBoxes261
The CheckBox Class261
5.11Formatting Numbers for Output264
Case Study: Ben's Breakfast Bar267
Summary282
Review Questions283
Exercises283
Programming Problems285
Chapter 6Advanced Concepts with Classes289
6.1Inheritance290
6.2An Example of Inheritance292
6.3Overriding Superclass Methods299
6.4Polymorphism303
6.5Instanceof Operator307
6.6Shadowed Variables309
6.7Inner Classes312
6.8Abstract Methods and Classes312
Case Study: Boats317
6.9Interfaces339
6.10Constructors Revisited345
6.11Instance Methods Revisited347
6.12Object Properties348
Comparing Objects348
Copying Objects350
Passing Objects as Parameters352
Case Study: Arithmetic of Rational Numbers353
6.13Garbage Collection and Object Finalization361
Summary363
Review Questions365
Exercises366
Programming Problems371
Chapter 7Exceptions and Streams375
7.1Introduction376
7.2Exception Classes377
7.3Catching an Exception379
7.4Catching Multiple Exceptions383
7.5Creating Your Own Exception Class387
7.6Throwing an Exception390
7.7Finally Blocks394
7.8Using Exception Handling396
7.9Stream Input and Output398
7.10The Stream Tokenizer Class404
7.11Text File Processing407
Book Example Problem412
Another Example: Using a File Viewer417
7.12The FileDialog Class419
Case Study: Reporting on the Statistics of a Text File422
Summary433
Review Questions434
Exercises435
Programming Problems438
Chapter 8An Introduction to the java.awt Package443
8.1Creating a Container444
8.2Handling an Event448
8.3Adding a Button to the Container451
8.4Adding Labels, Fonts, and Text Fields to a Container457
Labels457
Fonts458
Text Fields461
8.5Adding Check Boxes, Radio Buttons, and Lists to a Container465
Check Boxes465
Radio Buttons468
List472
8.6Creating a Reusable Container476
8.7Creating a Reusable WritingPad Component480
8.8Creating a Reusable DialogBox Component486
8.9Creating a Reusable CheckBoxes Component491
8.10Java Swing497
Summary497
Review Questions499
Exercises500
Programming Problems500
Chapter 9Vectors, Serialization, and the java.awt Graphics Class501
9.1Vectors502
Case Study: Chemical Elements508
9.2Saving and Loading Serializable Objects520
9.3The Graphics Class524
9.4Mouse Events527
9.5Pop-Up Menus534
9.6Painting the Screen544
9.7Printing Objects548
Summary558
Review Questions558
Exercises559
Programming Problems560
Chapter 10Objects Working Together563
10.1Packages564
10.2Associations570
10.3CRC Cards582
10.4Aggregation586
10.5Composition598
10.6Building a Student Management System599
10.7Menus Revisited604
10.8Testing the Student Management System608
Summary613
Review Questions614
Exercises615
Programming Problems616
Chapter 11Applets and Threads619
11.1Introduction620
11.2Applets622
11.3Input to Applets628
11.4Playing Sounds634
11.5Displaying Images637
11.6Loading Images639
11.7Arrays Revisited641
11.8Image Maps645
11.9Threads649
Case Study: An Example of Multithreading657
11.10Animation668
11.11Restrictions673
11.12Sound and Images with Applications674
Sound675
Images675
11.13Conclusion676
Summary677
Review Questions679
Exercises680
Programming Problems682
Chapter 12Sorting, Searching, and Dynamic Data Structures685
12.1Sorting686
12.2Class java.util.Arrays--Sort
12.3Sequential Search700
12.4Class java.util.Arrays--Binary Search
12.5Linked Lists708
LinkedList Class718
12.6Stacks726
Case Study: Using a Stack for Converting Algebraic Expressions728
Summary738
Review Questions739
Exercises739
Programming Problems739
Appendix ATables743
A.1ASCII Characters743
A.2Java Primitive Data Types744
A.3Operator Priorities745
A.4Escape-Sequence Characters746
Appendix BSyntax of Java747
B.1Productions of Lexical Structures747
B.2Productions from Types, Values, and Variables747
B.3Productions from Names748
B.4Productions from Packages748
B.5Productions Used Only in the LALR(1) Grammar749
B.6Productions from Classes749
Productions from Class Declarations749
Productions from Field Declarations750
Productions from Method Declarations751
Productions from Static Initializers751
Productions from Constructor Declarations751
B.7Productions from Interfaces752
Productions from Interface Declarations752
B.8Productions from Arrays752
B.9Productions from Blocks and Statements753
B.10Productions from Expressions756
Appendix CAnswers to Exercises761
Index805

Customer Reviews

Average Review:

Write a Review

and post it to your social network

     

Most Helpful Customer Reviews

See all customer reviews >