Basic HTML version of Foils prepared June 5 99

Foil 41 Java Language Basics

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. by Geoffrey C. Fox


Java syntax has many similarities to C and C++.
Some differences
  • No malloc or free - it has automatic garbage collection.
  • No pointers - designers felt pointer arithmetic not robust or safe.
  • Can declare variables almost anywhere as needed.
  • No struct, union, enum, typedef from C- it has classes and objects instead.
  • Primitive types for integers and floats have machine independent semantics.
  • Booleans in Java have value either "true" or "false" (not 0,1,...).
Some similarities
  • All variables must be declared
  • Syntax and comments
  • Control structures: if, while, and for statements, expressions



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sat Jun 5 1999