Which is the best way to use for String concatenation in
Java?

Answer Posted / sureshreddy

class String
{
public static void main(String args[])
{
String s1="hai";
String s2="suresh";
String s3=s1.concat(s2);
System.out.println(s3);

}
}

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you take thread dump in java?

774


What is nullpointerexception?

775


What is the difference between reader/writer and inputstream/output stream?

800


Is {a, n, d} a palindrome? If you are given a random string, is it a palindrome or not?

825


Is it possible to use Semaphore/ Mutex in an Interrupt Handler?

780


What is final method in java?

767


What string is utf8?

754


What is the base class for error and exception?

793


What is implicit object in java?

835


What is main function purpose?

769


What is regex in java?

725


Does constructor return any value?

799


Is void a return type?

751


What are different access specifiers in java?

770


What is the difference between arraylist and hashset in java?

799