Article View: borland.public.jbuilder.java.language
Article #18081system.out.print question
From: Christian Hallqvist
Date: Tue, 18 Aug 1998 00:00
Date: Tue, 18 Aug 1998 00:00
48 lines
1464 bytes
1464 bytes
As a beginner with both java and jbuilder I suspect
(and hope) the question I have is easy. Btw my station
has NT.
My program looks like this:
public class Hello {
public static void main(String args[]) {
System.out.print("Hello ");
System.out.print("World");
System.out.print("!!");
}
}
The output in the execution log looks like this:
Hello
World!!
A newline is inserted after 'Hello'. How is that possible?
Strangewise if changed to
public class Hello {
public static void main(String args[]) {
System.out.print("FirstWord");
System.out.print("Hello ");
System.out.print("World");
System.out.print("!!");
}
}
The output in the execution log looks like this:
FirstWord
Hello World!!
When I try the same with 1.1.6-java under linux
I see the 'correct' output of both programs:
output 1:
Hello World!!
output 2:
FirstWordHello World!!
Technical Details
Message-ID:
<35d96f99.0@pfaff.ethz.ch>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,f5ddb81893d4433e,start X-Google-Attributes: gidf74b3,public From: hall@kom.id.ethz.ch (Christian Hallqvist) Subject: system.out.print question Date: 1998/08/18 Message-ID: <35d96f99.0@pfaff.ethz.ch> X-Deja-AN: 382266004 Summary: system.out.print newline X-Trace: 18 Aug 1998 14:12:09 +0100, 129.132.40.5 Organization: Swiss Federal Institute of Technology (ETHZ) Keywords: system.out.print newline Newsgroups: borland.public.jbuilder.java.language