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++ .