From MAILER-DAEMON Thu Feb 3 22:22:08 2000 Date: 03 Feb 2000 22:22:08 -0500 From: Mail System Internal Data Subject: DON'T DELETE THIS MESSAGE -- FOLDER INTERNAL DATA X-IMAP: 0949634528 0000000000 Status: RO This text is part of the internal format of your mail folder, and is not a real message. It is created automatically by the mail system software. If deleted, important folder data will be lost, and it will be re-created with the data reset to initial values. From dis@cs.cornell.edu Wed Feb 2 20:12:48 2000 +0000 Status: R X-Status: X-Keywords: Path: newsstand.cit.cornell.edu!not-for-mail From: tyan@cs.cornell.edu (Thomas Yan) Newsgroups: cornell.class.cs100 Subject: Splitting a long statement into multiple lines Date: 2 Feb 2000 20:12:48 GMT Organization: Cornell University Lines: 33 Sender: verified_for_usenet@cornell.edu (tky1 on fresno.cs.cornell.edu) Message-ID: <87a340$j49$2@news01.cit.cornell.edu> NNTP-Posting-Host: fresno.cs.cornell.edu Mime-Version: 1.0 Content-Type: Text/Plain; charset=US-ASCII X-Trace: news01.cit.cornell.edu 949522368 19593 128.84.248.196 (2 Feb 2000 20:12:48 GMT) X-Complaints-To: usenet@news01.cit.cornell.edu NNTP-Posting-Date: 2 Feb 2000 20:12:48 GMT X-Newsreader: WinVN 0.99.9 (Released Version) (x86 32bit) Xref: newsstand.cit.cornell.edu cornell.class.cs100:254 if a statement is too long to fit on one line (too long means it would get cut-off or poorly wrapped when printed), then you should split it across multiple lines. the main things to remember are: + you may not split an identifier (name) + to split a string, you must break it up into smaller strings and concatenate them back together. for example, System.out.println("this statement is 2 long for 1 line"); could be written as System.out.println("this statement is 2" + " long for 1 line"); note that $ $ at the start of the string on the second line; without it, $2$ and $long$ would be put together as $2long$ instead of $2 long$, with a space between them. the following also produces the same output as the original, but the formatting is a little confusing, since $(100-98)$ is split: System.out.println("this statement is " + (100- 98) + " long for 1 line"); it is better formatted like this: System.out.println("this statement is " + (100-98) + " long for 1 line");