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

Question #3489
(3) Write a program to copy array of characters in to a string? And display it on screen.
1
Expert's answer
2011-08-16T11:53:20-0400
public class CharactersIntoString
{
public static void main(String[] args)
{
char[] charactersArray = {'s', 'o', 'm', 'e', ' ', 's', 't', 'r', 'i', 'n', 'g'};
String str = "";
for (int i = 0; i < charactersArray.length; i++)
str += charactersArray[i];
System.out.println("The result string = " + str);
}
}

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
New on Blog
APPROVED BY CLIENTS