belongs to collection: all string programs in java with examples
Write a Java program to concatenate two string
In this demo I have used NetBeans IDE 8.2 for debugging purpose. But you can use any java programming language compiler as per your availability..
public class Javaexcercise { public static void main(String[] args) { String str1 = "Tech"; String str2 = "Study"; System.out.println("String 1: " + str1); System.out.println("String 2: " + str2); // Concatenating the two strings together. String str3 = str1.concat(str2); System.out.println("The concatenated string: " + str3); } }
Result:
String 1: Tech
String 2: Study
The concatenated string: TechStudy
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
In this demo I have used NetBeans IDE 8.2 for debugging purpose. But you can use any java programming language compiler as per your availability..
Result:
String 1: Tech
String 2: Study
The concatenated string: TechStudy
need an explanation for this answer? contact us directly to get an explanation for this answer