Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to concatenate two strings in java

public class Main
{
	public static void main(String[] args) {
		
		String str1 = "Hello";
		String str2 = "People";
		String str3 = str1 + str2;   // Concatinating two string variables
		
		System.out.println(str3);
		System.out.println(str3 + "!!!");    // Concatinating string variable with a string
	}
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #concatenate #strings #java
ADD COMMENT
Topic
Name
9+4 =