This was the sample code he discussed:
public class Roses {
/**
* Prints a poem (of sorts) on multiple lines.
* @param args unused
*/
public static void main(String[] args) {
System.out.println("Roses are red,\n\tViolets are blue,\n" /* line1 */
+ "Sugar is sweet,\n\tBut I have \"commitment issues\",\n\t" /* line2 */
+ "So I'd rather just be friends\n\tAt this point in our " /* line3 */
+ "relationship.");
}
}
When I asked him about concatenating lines 1-3, I wanted to know if the style required you to concatenate them when entering to a new line in the IDE or if the string would carry on without. His answer was a bit cryptic, so I wanted to ask if you can break up a single string onto multiple lines without concatenation in Java...or if you have to do that?
Thank you

New Topic/Question
Reply




MultiQuote






|