JMU
An Introduction to Java
for FORTRAN 90 Programmers


Prof. David Bernstein
James Madison University

Computer Science Department
bernstdh@jmu.edu


Basic Style Issues
Basic Language Issues
Naming Conventions
Primitive Types
FORTRAN
Type
INTEGER
REAL
CHARACTER
LOGICAL
Java
Type Memory Range
byte 1 byte -128 to 127
short 2 bytes -32,768 to 32,767
int 4 bytes -2,147,483,648 to 2,147,483,647
float 4 bytes
double 8 bytes
char 2 bytes Unicode
boolean 1 bit true or false
Declarations
"Constants"
Arithmetic Operators
Arithmetic Operators (cont.)
Logicals/Booleans
Relational Operators
Characters
Strings
Strings (cont.)
Arrays
Arrays (cont.)
Arrays (cont.)
Derived/User-Defined Types
Derived/User-Defined Types (cont.)
Control Structures
Control Structures (cont.)
Control Structures (cont.)
Functions/Subroutines/Methods
Functions/Subroutines/Methods (cont.)
Input/Output