Describe 2 different ways to concatenate two strings.



Describe 2 different ways to concatenate two strings...

Answer / Raj Kumar

Two common methods to concatenate two strings in Java are using the + operator (e.g., String result = str1 + str2) or using the StringBuilder/StringBuffer's append method (e.g., StringBuilder sb = new StringBuilder(); sb.append(str1).append(str2);)

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

suppose we have an interface & that interface contains five methods. if a class implements that interface then we have to bound that to give tha definition of all five methods in that class. If we declare that class as abstract then can we call only two methods to give the deinition of that method & i don't want to give the definition of all the methods? can it possible

6 Answers   HP, Wipro,


I want to persist data of objects for later use. What is the best approach to do so?

1 Answers  


What services that container provides?

2 Answers  


Can we call a non-static method from inside a static method?

1 Answers  


what is the J2EE BluPrints?

0 Answers  


how to transactions(Bank transactions) in business process in ejb?

1 Answers   Photon,


How could Java classes direct program messages to the system console, but error messages, say to a file?

2 Answers  


When should I use a singleton?

1 Answers  


How can u create the Object of class Without using "New" opertor?

3 Answers   IBM, TCS,


What is http client in java?

1 Answers  


What is the difference between static and global variables and also define what are volatile variables?

1 Answers   Flextronics, Hexaware,


What is stream api in java8?

1 Answers  


Categories