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

Answer Posted / harshal

'+'operator is the best way to concatenate bcz by using
this operator we can concatenate more than two strings.
This is not possible by using concat method.
But performanace wise "append" is better than "+".

Is This Answer Correct ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which command from the jdk compiles a java program?

495


Which is illegal identifier in java?

594


what invokes a threads run() method? : Java thread

576


What is difference between jdk,jre and jvm?

575


What are class members by default?

664






What is boolean false?

531


What is difference between classpath and path variables in java?

564


Say you want to store the information about a number of pets in an array. Typical information that you could store for each pet (where relevant) would be • Breed of animal • Animal's name • Its birth date • Its sex • Whether it has been sterilised or not • When it is due for its next inoculation • When it last had its wings clipped For each type of pet (eg. dog, cat or bird) you would typically define a class to hold the relevant data. Note: You do not need to implement these classes. Just answer the following questions. 3.1.1 What would be the advantage of creating a superclass (eg. Pet) and declaring an array of Pet objects over simply using an array of Objects, storing each of the instances of the different pet classes (eg. Dog, Cat or Bird) in it? 3.1.2 Would you define Pet as a class or as an interface? Why? (2) (2)

1353


Explain about oops concepts.

638


What advantage do java's layout managers provide over traditional windowing systems?

553


What type of language is java?

548


What is the use of default method in interface in java? Explain

555


What is the meaning of course?

589


What is jvm? Why is java called the platform independent programming language?

551


How to split arraylist elements in java?

607