Chapter 2. Moving from Fortran to Java


If you are moving from Fortran to Java, there will be a learning curve. Java is a C and C++ based language, and the basic syntax used by Java is different than Fortran. What's more, Java is an object-oriented language. You will have to learn to think and program in an object-oriented manner. The good news is that simplicity was one of the design goals of the developers who created Java. It's much easier moving from Fortran to Java than it is to move from Fortran to a language like C++.

You will quickly realize that Java is more powerful and versatile than Fortran. There are more programming constructs and more ways of customizing programming elements. Java is a more comprehensive language as well. It offers a lot more features and can be used for a wider range of programming disciplines. The Fortran libraries are limited in scope, consisting mainly of mathematical functions. Java has enormous libraries covering almost every conceivable programming need. You will find when developing complicated multidisciplinary applications that a lot of the programming work has already been done for you.

This chapter will shed some light on the things you will have to learn and consider when moving to the Java world. It will focus not only on the basic syntactical differences but also touch briefly on object-oriented programming concepts that you will need to know. This chapter is not meant to be a compre hensive tutorial for either Fortran or Java. For a detailed description of the core elements of the Java language, look to Chapters 5 “16.

The specific topics we will discuss in this chapter are ”

  • Program structure

  • Basic syntax

  • Variables

  • Subroutines, functions, and methods

  • Arrays

  • Dynamic memory allocation

  • Pointers

  • Exception handling

  • Libraries

  • Built-in math functions

  • Input/Output capabilities

  • GUIs and web-based applications



Technical Java. Applications for Science and Engineering
Technical Java: Applications for Science and Engineering
ISBN: 0131018159
EAN: 2147483647
Year: 2003
Pages: 281
Authors: Grant Palmer

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net