您的位置:寻梦网首页编程乐园Java天地Core JavaJava Lecture Notes
Introduction
Content
Apply
Reflect
Extend
previous.gif
 (3087 bytes)
next.gif
 (2959 bytes)

 
 
Content Index
Content Page # 13

Layout

To the compiler, it is irrelevant how the program text is laid out. That is, this group of statements:

x = 2; y = 3; System.out.println(x + y);

is exactly the same as 

x = 2; 
y = 3; 
System.out.println(x + y);
or
x = 2; 
y = 3; 
System.out.println(x + y);
However, they are very different to the human reader. Layout used carefully can make it much easier to understand a program, and very much easier to find syntax errors. There are various different conventions for laying out computer programs. The example programs in this module are the personal preference of the module team; the examples in Deitel and Deitel illustrate a slightly different technique. It doesn't matter which style you adopt, but you should use it consistently. For example, if you insert two blank lines between methods, you should always use two blank lines.

Back to top

basicline.gif (169 bytes)

RITSEC - Global Campus
Copyright © 1999 RITSEC- Middlesex University. All rights reserved.
webmaster@globalcampus.com.eg