September 2005
Beginner
576 pages
13h 6m
English
| Q1: | Is a line in a Java program the same thing as a statement? |
| A1: | No. Although the programs you will create in this book put one statement on each line, this is done to make the programs easier to understand; it's not required.
The Java compiler does not consider lines, spacing, or other formatting issues when compiling a program. The compiler just wants to see semicolons at the end of each statement. You can put more than one statement on a line, although this makes a program more difficult for humans to understand when they read its source code. For this reason, it is not generally recommended. |
| Q2: | Is there a reason to set up a variable without giving it a value right away? |
| A2: | For many of the simple programs you will be creating in the first ... |
Read now
Unlock full access