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
make relation with java and me
Posted by trilochan on December 15, 2000 at 12:02 AM
> 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" ;
> 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++ .