New Line Using String Code Example

Snippet 1

  // its rn
String a = "Hello, "
String b = "there!"
System.out.println(a+b);//returns Hello, there
System.out.println(a+"rn"+b);//returns Hello, 
//there! //it will be on the next line! 

Snippet 2

  String line1 = "Humpty Dumpty sat on a wall.";
String line2 = "Humpty Dumpty had a great fall.";
String rhyme = line1 + "n" + line2; 

Similar Snippets

Creating Java Main Method Code Example – java

Find Duplicates In Arraylist Java Code Example – java

Java Creat A Folder Code Example – java

Firestore Find Doc And Set Data Code Example – java

Create Copy Of Array From Another Array Code Example – java

Copyright © Code Fetcher 2020




Leave a comment

Your email address will not be published. Required fields are marked *