Answer to Question #3485 in Java | JSP | JSF for Y mukundareddy

Question #3485
(1) Write a program to concatenate two strings?
1
Expert's answer
2011-08-07T07:21:23-0400

public class StringConcatenator
{
public static void main(String[] args)
{
& String str1 = "Hello,";
& String str2 = " World!";
& String concat = str1 + str2; & // Concatenating of two strings

& System.out.println("First string = '" + str1 + "'");
& System.out.println("Second string = '" + str2 + "'");
& System.out.println("The concatenated string = '" + concat + "'");
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS