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

 
 
Content Index
Content Page # 14

Layout convention: blank lines

Leave a blank line between the declaration of a variable and a non-declaration statement that follows. The helps the human reader of the program distinguish between variable declarations and other kinds of program statement.

Java (like most modern programming languages) ignores blank lines.

loat discountTicketRage;
int age;
System.out.println("Please enter your age");
 
With such a blank line a program might look as follows:
float discountTicketRage;
int age;

System.out.println("Please enter your age");

With a blank line inserted after the declaration of the last variable, it is easier to see where the 'action' starts.
 


Back to top

basicline.gif (169 bytes)

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