Developers: Learn a New Programming Language or App Development with Deitel LiveLessons Videos!
Login  |  Register  |  Media Kit  |  Press  |  Contact Us  |   Twitter Become a Deitel Fan on Facebook  
Custom Search

AddThis Social Bookmark Button

Table of Contents: Small Java How to Program

1Introduction to Computers, the Internet and the World Wide Web 1
1.1Introduction 2
1.2What Is a Computer? 4
1.3Computer Organization 4
1.4Early Operating Systems 5
1.5Personal, Distributed and Client/Server Computing 6
1.6The Internet and the World Wide Web 6
1.7Machine Languages, Assembly Languages and High-Level Languages 7
1.8History of C and C++ 8
1.9History of Java 9
1.1Java Class Libraries 9
1.11FORTRAN, COBOL, Pascal and Ada 11
1.12BASIC, Visual Basic, Visual C++, C# and .NET 11
1.13Typical Java Development Environment 12
1.14Notes about Java and Small Java How to Program, Sixth Edition 15
1.15Test-Driving a Java Application 16
1.16Introduction to Object Technology and the UML 21
1.17Wrap-Up 26
1.18Web Resources 26
2Introduction to Java Applications 35
2.1Introduction 36
2.2First Program in Java: Printing a Line of Text 36
2.3Modifying Our First Java Program 43
2.4Displaying Text with printf 45
2.5Another Java Application: Adding Integers 47
2.6Memory Concepts 51
2.7Arithmetic 52
2.8Decision Making: Equality and Relational Operators 56
2.9Wrap-Up 60
3Introduction to Classes and Objects 72
3.1Introduction 73
3.2Classes, Objects, Methods and Instance Variables 73
3.3Declaring a Class with a Method and Instantiating an Object of a Class 75
3.4Declaring a Method with a Parameter 79
3.5Instance Variables, set Methods and get Methods 82
3.6Primitive Types vs. Reference Types 87
3.7Initializing Objects with Constructors 88
3.8Floating-Point Numbers and Type double 91
3.9(Optional) GUI and Graphics Case Study: Using Dialog Boxes 95
3.1Wrap-Up 98
4Control Statements: Part 1 106
4.1Introduction 107
4.2Algorithms 107
4.3Pseudocode 108
4.4Control Structures 108
4.5if Single-Selection Statement 111
4.6if else Double-Selection Statement 112
4.7while Repetition Statement 117
4.8Formulating Algorithms: Counter-Controlled Repetition 118
4.9Formulating Algorithms: Sentinel-Controlled Repetition 123
4.1Formulating Algorithms: Nested Control Statements 130
4.11Compound Assignment Operators 136
4.12Increment and Decrement Operators 137
4.13Primitive Types 139
4.14(Optional) GUI and Graphics Case Study: Creating Simple Drawings 140
4.15Wrap-Up 145
5Control Statements: Part 2 157
5.1Introduction 158
5.2Essentials of Counter-Controlled Repetition 158
5.3for Repetition Statement 160
5.4Examples Using the for Statement 164
5.5do while Repetition Statement 169
5.6switch Multiple-Selection Statement 170
5.7break and continue Statements 178
5.8Logical Operators 180
5.9Structured Programming Summary 186
5.1(Optional) GUI and Graphics Case Study: Drawing Rectangles and Ovals 191
5.11Wrap-Up 194
6Methods: A Deeper Look 204
6.1Introduction 205
6.2Program Modules in Java 206
6.3static Methods, static Fields and Class Math 207
6.4Declaring Methods with Multiple Parameters 210
6.5Notes on Declaring and Using Methods 214
6.6Method Call Stack and Activation Records 215
6.7Argument Promotion and Casting 215
6.8Java API Packages 217
6.9Case Study: Random-Number Generation 219
6.1Case Study: A Game of Chance (Introducing Enumerations) 224
6.11Scope of Declarations 229
6.12Method Overloading 232
6.13(Optional) GUI and Graphics Case Study: Colors and Filled Shapes 235
6.14Wrap-Up 237
7Arrays 252
7.1Introduction 253
7.2Arrays 253
7.3Declaring and Creating Arrays 255
7.4Examples Using Arrays 256
7.5Case Study: Card Shuffling and Dealing Simulation 265
7.6Enhanced for Statement 268
7.7Passing Arrays to Methods 270
7.8Case Study: Class GradeBook Using an Array to Store Grades 274
7.9Multidimensional Arrays 278
7.1Case Study: Class GradeBook Using a Two-Dimensional Array 283
7.11Variable-Length Argument Lists 289
7.12Using Command-Line Arguments 290
7.13(Optional) GUI and Graphics Case Study: Drawing Arcs 292
7.14Wrap-Up 295
8Classes and Objects: A Deeper Look 316
8.1Introduction 317
8.2Time Class Case Study 318
8.3Controlling Access to Members 321
8.4Referring to the Current Object’s Members with the this Reference 322
8.5Time Class Case Study: Overloaded Constructors 325
8.6Default and No-Argument Constructors 330
8.7Notes on Set and Get Methods 331
8.8Composition 332
8.9Enumerations 334
8.1Garbage Collection and Method finalize 338
8.11static Class Members 339
8.12static Import 344
8.13final Instance Variables 345
8.14Software Reusability 347
8.15Data Abstraction and Encapsulation 348
8.16Time Class Case Study: Creating Packages 349
8.17Package Access 355
8.18(Optional) GUI and Graphics Case Study: Using Objects with Graphics 355
8.19Wrap-Up 360
9Object-Oriented Programming: Inheritance 369
9.1Introduction 370
9.2Superclasses and Subclasses 371
9.3protected Members 373
9.4Relationship between Superclasses and Subclasses 374
9.5      Constructors in Subclasses Constructors in Subclasses 398
9.6Software Engineering with Inheritance 404
9.7Object Class 405
9.8(Optional) GUI and Graphics Case Study: Displaying Text and Images Using Labels 407
9.9Wrap-Up 409
10Object_-Oriented Programming: Polymorphism 413
10.1Introduction 414
10.2Polymorphism Examples 416
10.3Demonstrating Polymorphic Behavior 417
10.4Abstract Classes and Methods 420
10.5Case Study: Payroll System Using Polymorphism 422
10.6final Methods and Classes 437
10.7Case Study: Creating and Using Interfaces 438
10.8(Optional) GUI and Graphics Case Study: Drawing with Polymorphism 450
10.9Wrap-Up 452
AOperator Precedence Chart 456
A.1Operator Precedence 456
B ASCII Character Set 458
C Keywords and Reserved Words 459
D Primitive Types 460
E Number Systems 461
E.1Introduction 462
E.2Abbreviating Binary Numbers as Octal and Hexadecimal Numbers 465
E.3Converting Octal and Hexadecimal Numbers to Bi­nary Numbers 466
E.4Converting from Binary, Octal or Hexadecimal to Decimal 466
E.5Converting from Decimal to Binary, Octal or Hexadecimal 467
E.6Negative Binary Numbers: Two’s Complement Notation 469
F Unicode  474
F.1Introduction 474
F.2Unicode Transformation Formats 475
F.3Characters and Glyphs 476
F.4Advantages/Disadvantages of Unicode 477
F.5Unicode Consortium’s Web Site 477
F.6Using Unicode 479
F.7Character Ranges 481
G Using the Java API Documentation 485
G.1Introduction 485
G.2Navigating the Java API 486
H Creating Documentation with javadoc 495
H.1Introduction 495
H.2Documentation Comments 495
H.3Documenting Java Source Code 496
H.4javadoc 503
H.5Files Produced by javadoc 504
I  Labeled break and continue Statements 507
I.1Introduction 507
I.2Labeled break Statement 507
I.3Labeled continue Statement 508
J Using the Debugger 510
J.1Introduction 511
J.2Breakpoints and the run, stop, cont and print Commands 511
J.3The print and set Commands 516
J.4Controlling Execution Using the step, step up and next Commands 518
J.5The watch Command 521
J.6The clear Command 523
J.7Wrap-Up 526

© 1992-2005. Deitel & Associates, Inc. All Rights Reserved.  



Discounts on subscriptions

Small Java How to Program Cover

ISBN: 0131486608
© 2005, pp. 600

Order now at

Download Code
Examples and
Other Premium
Content for
Registered Users

Login or Register to download this book's code examples and other premium content.

Update :: May 29, 2017