5.1. Discussion of Java and These Notes

Java is a programming language that is a fusion of two earlier languaves, C++ and Smalltalk. It is intended to look similar, on its surface, to C++, so that it is easy for C++ programmers to learn. But under the hood, it is much more like Smalltalk. So you can say that Java is Smalltalk with C++ syntax.

Important rule: Java has a rigid language. Use only features that you have learned. Do not try to make up the language as you go and hope that it is right.


Free form

Java is a free-form language. That means that

  1. in most places, an end-of-line is treated like a blank;
  2. in most places, any sequence of blanks, tabs or end-of-line characters is treated the same as a single blank.
Normally, you indent your program to make it readable. See the coding standards for how to indent for this course.

Places where the free-form rule is not in effect include

  1. comments that begin with // and end at the end of the line;
  2. string constants, such as "Blanks  matter  here".