Available:*
Library | Item Barcode | Call Number | Material Type | Item Category 1 | Status |
---|---|---|---|---|---|
Searching... | 30000010124745 | QA76.73.J38 F594 2007 | Open Access Book | Book | Searching... |
On Order
Summary
Summary
Java Programming for the Absolute Beginner provides you with an introduction to Java that allows you to learn the fundamentals of object-oriented programming while becoming acquainted with many of the core features of Java. This book starts with the assumption that you have not previously written a computer program. It then walks you through the creation of a variety of games and applications. After you have your footing with the basics, you learn to develop your own systems of classes, and by the end of the book, you are working with many of Java's Graphical User Interface (GUI) features and developing a desktop Windows application. This book provides a solid introduction for anyone desiring a relaxed, fully guided tour of the fundamentals of Java, programming, and the objectoriented approach to application development.
Table of Contents
Chapter 1 Getting Started | p. 1 |
The HelloWeb Applet | p. 2 |
What Is Java? | p. 2 |
Java Is a Programming Language | p. 3 |
Java Is Platform Independent | p. 4 |
Java Is Object Oriented | p. 5 |
Classes and Objects | p. 6 |
Attributes and Methods | p. 6 |
Why Learn Java? | p. 6 |
Pathways to Learning Java | p. 7 |
Where to Start | p. 7 |
Installing and Setting Up the JDK | p. 8 |
Accessing the Sun Site | p. 8 |
The JDK Installation Executable | p. 9 |
Starting Your Windows Installation | p. 9 |
Windows Installation and Setup Continued | p. 10 |
Verifying and Copying the Path to Your JRE | p. 10 |
Setting the Path Variable | p. 11 |
Writing Your First Program | p. 11 |
Setting Up to Work with DOS | p. 11 |
DOS Commands | p. 14 |
Creating a Hello World Program | p. 16 |
HelloWorld Syntax Basics | p. 17 |
Compiling the Hello World Program | p. 20 |
Running the Hello World Program | p. 21 |
Writing Your First Applet | p. 23 |
Applet Code | p. 23 |
Compiling the Applet Code | p. 25 |
Writing an HTML File for an Applet | p. 26 |
Using the Applet Viewer | p. 27 |
Running Your Applet in the Browser | p. 28 |
Summary | p. 29 |
Chapter 2 Variables, Data Types, and Simple IO | p. 31 |
The Name Game Application | p. 32 |
Variables and Data Types | p. 32 |
Primitive Data Types | p. 33 |
Understanding Literals | p. 35 |
Casting and Type Promotion | p. 36 |
Strings and Character Escape Codes | p. 37 |
Naming Variables | p. 39 |
Conventions | p. 40 |
Assignment and Initialization | p. 41 |
Working with Numbers | p. 45 |
Operators and Operands | p. 45 |
How to Do Math | p. 46 |
The TipAdder Program | p. 46 |
Formatting Decimal Precision | p. 48 |
Operator Precedence | p. 51 |
Getting User Input | p. 53 |
The BufferedReader Class | p. 55 |
The try...catch Block | p. 57 |
Parsing Strings to Numbers | p. 58 |
Accepting Command-Line Arguments | p. 62 |
Strings and String Operations | p. 64 |
The Name Game | p. 66 |
Summary | p. 69 |
Chapter 3 The Fortune Teller: Random Numbers, Conditions, and Arrays | p. 71 |
The Fortune Teller Application | p. 72 |
Generating Random Numbers | p. 72 |
The Math Class | p. 73 |
The Random Class | p. 75 |
Generating Different Types of Random Numbers | p. 76 |
Seeding Values | p. 78 |
More of the Math Class | p. 81 |
Flow and Selection | p. 85 |
Conditions and Conditional Operators | p. 86 |
Single-Entry Selection | p. 87 |
The Ternary Operator | p. 91 |
Boolean Operators | p. 91 |
The if...else Statement | p. 94 |
The Temperature Conversion Program | p. 95 |
The if...else if...else Statement | p. 97 |
The switch Structure | p. 100 |
The Dice Roller Program | p. 102 |
Arrays | p. 104 |
Declaring Arrays | p. 106 |
Assigning Values to Arrays | p. 107 |
Combined Declaration and Initialization | p. 108 |
Accessing Array Values | p. 108 |
The Array Use Program | p. 109 |
The Fortune Teller Revisited | p. 112 |
Summary | p. 115 |
Chapter 4 Repetition Statements and Exception Handling | p. 117 |
The Guess-a-Number Application | p. 118 |
Flow as Repetition | p. 118 |
The for Statement | p. 119 |
The Racer Program | p. 120 |
Basic Repetition Activities | p. 122 |
Redefinition of Control Variables | p. 123 |
Control and Unary Operators | p. 124 |
Variations on Intervals | p. 126 |
Compound Assignment Operators | p. 128 |
Variations on the Use of the for Structure | p. 131 |
Nested Repetition Blocks | p. 134 |
The while Statement | p. 138 |
The do...while Statement | p. 141 |
The continue and break Keywords | p. 144 |
Using throw and finally with try...catch Structures | p. 149 |
Back to Guessing a Number | p. 154 |
Summary | p. 158 |
Chapter 5 Object-Oriented Programming | p. 161 |
Object-Oriented Concepts | p. 162 |
States and Attributes | p. 162 |
Behaviors | p. 162 |
Attributes and Methods | p. 164 |
Picturing Classes | p. 165 |
Implementing a Class | p. 167 |
Defining Attributes | p. 169 |
Defining Methods | p. 169 |
Default Constructors | p. 171 |
Overloaded Constructors | p. 172 |
Creating a Test Driver Class | p. 174 |
Encapsulation | p. 178 |
Scope Considerations | p. 179 |
The Scope and ScopeTest Classes | p. 180 |
More on Methods | p. 184 |
Method Overloading | p. 184 |
Method Signatures and Return Operations | p. 186 |
Assignments and Cascading Calls | p. 188 |
Points of Return | p. 189 |
Static Methods and Attributes | p. 190 |
More on Constructors and the this Keyword | p. 193 |
Composition | p. 195 |
The Card Class | p. 197 |
The CardDeck Class | p. 201 |
Testing the Associated Classes | p. 205 |
Trump | p. 207 |
Summary | p. 211 |
Chapter 6 Building a Class Hierarchy | p. 213 |
Software Reusability | p. 214 |
Specialization and Generalization | p. 215 |
Creating a Class Hierarchy | p. 218 |
Concrete Classes | p. 220 |
A Concrete Base Class | p. 221 |
Testing the Base Car Class | p. 224 |
Second-Tier Classes | p. 226 |
Third-Tier Classes | p. 235 |
Method Overriding | p. 239 |
The Sedan Class and Overriding | p. 241 |
Testing the Sedan Class | p. 243 |
Finalization | p. 245 |
Polymorphism | p. 246 |
ChildCart | p. 248 |
DieselElectric | p. 250 |
GasElectric | p. 252 |
Using Polymorphic Options | p. 254 |
Summary | p. 258 |
Chapter 7 Abstract Classes and Interfaces | p. 261 |
Abstract Classes | p. 262 |
Abstract Methods | p. 263 |
Picturing Abstract Classes and Methods | p. 264 |
Using Abstraction in the Car Hierarchy | p. 267 |
The Car Class as an Abstract Class | p. 267 |
The Economy Class as an Abstract Class | p. 271 |
Creating a Concrete Class | p. 272 |
Other Concrete and Abstract Classes | p. 274 |
Polymorphic Uses of Abstract Data Types | p. 276 |
References and Identifiers | p. 276 |
References and Collections | p. 277 |
Interfaces | p. 282 |
Multiple Inheritance and the Use of Interfaces | p. 285 |
Picturing Interfaces | p. 286 |
Creating a Test Application | p. 287 |
Implementing a GUI Application | p. 287 |
Accommodating Window Closing Events | p. 293 |
Inner Classes | p. 296 |
Explicitly Named Inner Classes | p. 296 |
Inner Anonymous and Final Classes | p. 301 |
Summary | p. 304 |
Chapter 8 Graphic User Interface Activities | p. 305 |
Setting Up a Window | p. 306 |
Lab View A | p. 306 |
Layout Management | p. 312 |
Other Layout Managers | p. 315 |
Pluggable Look and Feel | p. 317 |
Adding Menu Features | p. 318 |
Arrays and Patterns | p. 321 |
Lab View B | p. 322 |
Event Handling | p. 331 |
The Handler | p. 332 |
Associating Events with Menu Items | p. 333 |
Identifying and Processing Messages | p. 333 |
JOptionPane Dialogs | p. 335 |
Window Location Using the Java Toolkit | p. 340 |
Use of a JLabel Object for a Status Bar | p. 342 |
Summary | p. 343 |
Chapter 9 Refactoring and Data Containers | p. 345 |
Custom Dialogs and the Lab View Application | p. 346 |
Refactoring and Software Patterns | p. 346 |
Models and Views | p. 348 |
Refactoring the showElements() Method | p. 349 |
Implementing the Elements Class | p. 351 |
Hashtable | p. 359 |
Hashtable Construction Activities | p. 361 |
Tokenizing a String | p. 366 |
Enumeration | p. 369 |
ArrayList | p. 370 |
String and StringBuffer | p. 373 |
Glyph Problems | p. 374 |
Tabs | p. 375 |
Cleaning Up Data | p. 375 |
The Inner Class and the finalize Method | p. 376 |
Mutator and Accessor Methods of the Elements Class | p. 377 |
Exceptions | p. 377 |
Summary | p. 378 |
Chapter 10 Extending Applications | p. 381 |
Using Dialogs to Extend the Application | p. 382 |
Child Windows | p. 384 |
The JDialog Window | p. 385 |
JDialog Construction | p. 391 |
Disposal and Initialization | p. 391 |
The Box Layout Manager | p. 392 |
Fonts | p. 393 |
Lab View Menu Considerations | p. 394 |
An Abstract Primary Dialog | p. 397 |
Mouse Drawing and Graphics | p. 400 |
Input/Output Operations | p. 407 |
Writing to a File | p. 412 |
Reading from a File | p. 413 |
Reading Information for a Help Dialog | p. 414 |
The TableMaker Class | p. 417 |
Layout for the Dialog | p. 427 |
Event Processing | p. 428 |
Processing Details | p. 430 |
Other Concerns | p. 431 |
Summary | p. 432 |
Appendix ConTEXT for Java | p. 435 |
Setting Up an Editor for Java | p. 435 |
Obtaining ConTEXT | p. 436 |
Installing ConTEXT | p. 437 |
Setting ConTEXT Options | p. 441 |
Accessing Your Java Files | p. 442 |
Selecting the Highlighter for Java | p. 443 |
Setting Up the Highlighter | p. 443 |
Setting Up Associations | p. 443 |
Setting the Backup Directory | p. 446 |
Word Wrap and the Ruler | p. 447 |
Setting the Function Keys | p. 447 |
Associating F9 with the javac Command | p. 447 |
Testing F9 | p. 448 |
Associating F10 with the java Command | p. 449 |
Testing F10 | p. 452 |
Index | p. 453 |