Technical Java

Prentice Hall
Grant Palmer  
Total pages
April 2003

Product detail

Title no longer available


This is a technical programming book written by a real scientific programmer filled with practical, real-life technical programming examples that teach how to use Java to develop scientific and engineering programs. The book is for scientists and engineers, those studying to become scientists and engineers, or anyone who might want to use Java to develop technical applications. "Technical Java" gives the reader all the information she needs to use Java to create powerful, versatile, and flexible scientific and engineering applications. The book is full of practical example problems and valuable tips. The book is for people learning Java as their first programming language or for those transitioning to Java from FORTRAN or C. There are two handy chapters at the beginning of the book that explain the differences and similarities between FORTRAN, C, and Java.

Table of Contents



1. Introduction to Java.

A Brief History of Java. What Java Is. Installing Java on Your Machine. Compiling and Running Java Programs.

2. Moving from Fortran to Java.

Program Structure. Basic Syntax. Variables. Subroutines, Functions, and Methods. Arrays. Dynamic Memory Allocation. Pointers. Exception Handling. Libraries. Built-in Math Functions. Input/Output Capability. GUIs and Web-Based Applications.

3. Moving from C to Java.

Program Structure. Basic Syntax. Java Classes vs. C Structs. Variables. Pointers. Functions and Methods. Arrays. Dynamic Memory Allocation. Exception Handling. C Libraries and the Java APIs. Strings. Built-in Math Functions. Basic Printing. Input/Output Capability. GUIs and Web-Based Applications.

4. Moving from C++ to Java.

Basic Syntax. Preprocessor Directives. Data Types. Pointers. Structures, Unions, Enumerations. Inheritance and Interfaces. Built-In Math Functions. Standard I/O. Strings. Memory Management.

5. An Overview of Object-Oriented Programming Concepts.

Objects. Classes. Encapsulation. Inheritance. Polymorphism.

6. Basic Syntax.

General Syntax and a Simple Java Program. Example: A Simple Java Program. Comments. Example: Using Comments. Operators. Arithmetic Operators. Assignment Operators. Increment/Decrement Operators. Relational Operators. Boolean Operators. Bitwise Operators. Miscellaneous Operators. Operator Precedence. Loops and Other Flow of Control Structures. if-else Statements. while Loops. do-while Loops. for Loops. switch Statements. Transfer of Control Statements. break Statements. continue Statements. return Statements. Basic Printing and Keyboard I/O.

7. Classes.

Class Declaration Syntax. Access Privileges. Objects. Declaring Fields. Declaring Methods. Constructors. Static Initialization Blocks. Making Copies of Objects. Nested Classes. Static Nested Classes. Instance Nested Classes. Anonymous Inner Classes. Encapsulation. Inheritance. Inheritance and Access Modifiers. Inheritance and Method Arguments. Member Hiding and Member Overriding. The super Keyword. The this Keyword. Abstract Classes. Final Classes. The Garbage Collector.

8. Variables.

Primitive and Reference Type Variables. Instance and Class Variables. Creating Variables. Naming Conventions and Restrictions. Access Modifiers. Accessing Variable Values. Final Variables. Transient and Volatile Variables. Casting. Variable Scope.

9. Methods.

Declaring Methods. Naming Conventions. Access Modifiers. Instance Methods. Static Methods. The main() Method. Input Parameters. Passing Arguments to Methods. Abstract Methods. Final Methods. The native and synchronized Keywords. Method Chaining. Method Overloading. Method Overriding. The return Statement.

10. Interfaces.

Differences Between Interfaces and Abstract Classes. Declaring an Interface. Interface Members. Implementing an Interface. Interfaces and Inheritance. Interface Instances as Input Parameters and Return Types.

11. Packages and JAR Files.

Defining a Package. import Declarations. CLASSPATH Environment Variable. Packages and Access Control. JAR Files.

12. Exception Handling.

The Exception Class Hierarchy. try Statements. The try Statement. The catch Clause. The finally Clause. The throw and throws Keywords.

13. Arrays.

One-Dimensional Arrays. Two-Dimensional Arrays. Arrays of More than Two Dimensions. Initializing Array Elements. Accessing Array Elements. Arrays as Method Arguments and Return Types. Array Length. Collection Classes in the Java API.

14. The Java Class Libraries.

Package Naming Conventions. The Core J2SE Libraries. java.lang. java.math. java.util. The GUI Libraries. java.awt. java.awt.event. javax.swing. javax.swing.border. javax.swing.event. javax.swing.table. javax.swing.text. javax.swing.tree.

15. Primitive Variable Wrapper and String Classes.

Primitive Variable Wrapper Classes. Creating Primitive Variable Wrapper Class Objects. Converting a Wrapper Class Object to a Primitive Value. The parse() Methods. The String Class. Obtaining String Objects. Concatenating Strings. Other Important String Class Methods. Converting Primitive and Reference Types to Strings. Converting Strings to Primitive Values.

16. Built-in Math Functions.

Math and StrictMath Classes. Mathematical Constants. Absolute Value Methods. Power and Square Root Methods. Transcendental Math Functions. Trigonometric Methods. Conversion Methods. Minimum and Maximum Methods. Rounding and Remainder Methods. Random Number Generator Methods. The java.math Package. Comparing the Built-in Math Capability of C, C++, Fortran, and Java. References.

17. User-Defined Math Functions.

Basic Plan of Attack. The Math2 Class. Logarithm Methods. Hyperbolic Trigonometric Methods. The Gamma Function. The Final Version of the Math2 Class. Compiling the Math2 Class. Using Math2 Class Methods. Comparing Java, C, and Fortran Values. References.

18. Building Class Hierarchies.

Defining the State and Behavior of a Gas Mixture. The General Class Hierarchy Structure. AbstractGas Class. PerfectGas Class. Air Class. RealGas Class. Species Class. N2 Class. N Class. NitrogenGas Class. Summary. References.

19. Solving Systems of Equations.

General Considerations. The EqnSolver Class. Test Case. Pivoting. Gauss-Jordan Elimination. Gaussian Elimination. Lower-Upper Decomposition. Matrix Inversion. Testing the EqnSolver Class Methods. Real Gas Viscosity Method.

20. Solving Differential Equations.

Ordinary Differential Equations. The ODE Class. Initial Value Problems. Runge-Kutta Schemes. Example Problem: Damped Spring Motion. SpringODE class. Solving the Spring Motion ODE. Embedded Runge-Kutta Solvers. Other ODE Solution Techniques. Two-Point Boundary Problems. Shooting Methods. Example Problem: Compressible Boundary Layer. The CompressODE Class. Solving the Compressible Boundary Layer Equations. Other Two-Point Boundary Solution Techniques. Partial Differential Equations. References.

21. Integration of Functions.

General Comments. Trapezoidal Algorithms. Simpson's Rule. Solving Improper Integrals. Gaussian Quadrature Methods. General Integral Types. Example: Thin Airfoil Theory. References.

22. Fourier Transforms.

The Fourier Transform. Discrete Fourier Transform. Analyzing Composite Signals. Sampling Theory. Spectral Leakage. Fast Fourier Transform.

23. Generic Class Libraries.

Analyzing the Problem. Example: Least Squares Fit. Implementing the Generic Part. Implementing the Problem-Specific Part. Testing the Generic Class Library.

24. Data Modeling and Curve Fits.

Least Squares Fit to a Polynomial Equation. The DataModeling Class. The Polynomial Class. Example Problem: Curve Fitting Specific Heat Data. Fitting to Nonpolynomial Equations. The Power Class. Other Data Modeling Techniques. References.

25. Java I/O.

General Concepts. Byte Input Streams. InputStream Class. BufferedInputStream Class. ByteArrayInputStream Class. DataInputStream Class. FileInputStream Class. FilterInputStream Class. ObjectInputStream Class. Other InputStream Subclasses. Byte Output Streams. OutputStream Class. BufferedOutputStream Class. ByteArrayOutputStream Class. DataOutputStream Class. FileOutputStream Class. FilterOutputStream Class. ObjectOutputStream Class. PrintStream Class. Character Input Streams. Reader Class. BufferedReader Class. FileReader Class. InputStreamReader Class. Other Reader Subclasses. Character Output Streams. Writer Class. BufferedWriter Class. FileWriter Class. OutputStreamWriter Class. PrintWriter Class. Other Writer Subclasses. Test Case: An Atmosphere Modeling Tool. Getting Input from Command Line Arguments. Using the Standard I/O Streams. Reading and Writing to a File. Saving and Restoring Objects. The java.nio Packages. References.

26. An Introduction to Java GUIs.

The Java GUI Libraries. The AtmGUI Class. Choosing a Container. Selecting the GUI Components. Adding the Components to the Container. Event Handlers. Other GUI elements. The Final Form of the AtmGUI class.

27. Creating Web-Based Applications Using Java Servlets.

Web-Based Application Basics. Java Servlets. Required Libraries and Tools. Example: A Web-Based Atmosphere Modeling Tool. HttpServlet Class. General Form of an HttpServlet Subclass. Extracting Input Parameters. Running Server-Based Applications. Sending Output Back to the Client Machine. The AtmServlet Class. Deploying the Web-Based Application.

Appendix: Java Keywords.


Back Cover

TechnicalJava™Developing Scientific and Engineering ApplicationsGrant PalmerThe practical, example-rich guide to Java technical programming

If you want to use Java todevelop scientific or engineering programs, Technical Java is the Java guide you'vebeen searching for. Using real-life examples, expert scientific programmerGrant Palmer shows how to build powerful, versatile, and flexible software forvirtually any technical application. Whether you're moving from FORTRAN,C, or C ++, or learning Java as your first language, Palmer covers all you needto know-

  • Java, FORTRAN, C, and C ++, similarities, differences, and migration issues
  • Java 1.4 syntax, objects, classes, methods, interfaces, variables, arrays, exceptions, packages, I/O, and more
  • Working with java.math and creating your own math functions-including detailed trigonometric and transcendental examples
  • Data modeling, in depth: class hierarchies, generic class libraries, least-squares fit, fitting to non-polynomial equations, and more
  • Solving differential equations and systems of equations, including Gauss-Jordan and Gaussian elimination, lower-upper decomposition, and matrix inversion
  • Solving integral equations with both proper and improper integrals
  • Working with Fourier transforms (DFT and FFT)
  • Building Web and GUI-based technical applications with Swing/AWT and servlets


Profession TechnicalReference

Upper Saddle River, NJ 07458

ISBN: 0-13-101815-9

UPC: 076092022398


About the Author

GRANT PALMER, a scientific programmer at NASA Ames Research Centerin Moffett Field, CA, specializes in computational fluid dynamics programmingto predict friction-related heat in reentering space vehicles. He has writtenor contributed to five Java books, including Java Event Handling (Prentice HallPTR). Palmer resides in Chandler, Arizona.