The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
November 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Hello Sir!!!

Posted by Kishori Sharan on November 30, 2000 at 4:25 PM

Hello Sir!!!
You cannot continue a string in two lines in java. There is no line continution character in java. You can already write a multiline statement.But, you cannot break a string in just two lines using backslash. So the following line is invalid
String str = "first line "
" second line" :
You cannot use backslash as string continution character in java. You have to write the code as
String str = "first line " +
"second line" ;
or
String str = "first line second line" ;

Java is not C or C++. So don't compare everything in C , C++ with Java. Just learn the rules of Java and apply them only when you are working in java and same goes for C/C++ .

Thanx
Kishori



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us