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

Answer Posted / govind

class stringadd
{
public static void main(String args[])
{
String a="hello";
System.out.println("the string is::"+a);
a+=" govind";
System.out.println("after concating::"+a);
}
}

Is This Answer Correct ?    10 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why to use nested classes in java?

599


How do you override a method in java?

544


Is there any case when finally will not be executed?

534


Can vector have duplicates in java?

516


How are variables stored in memory?

593






What is an class?

601


How can we run a java program without making any object?

554


What are voids?

547


What is compareto?

552


What is nested loop? What is dangling else condition in it?

587


What are the fileinputstream and fileoutputstream?

580


When is the arraystoreexception thrown?

587


Can an interface extend a class?

555


Does isempty check for null?

582


Which is the class in java?

526