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
Which command from the jdk compiles a java program?
Which is illegal identifier in java?
what invokes a threads run() method? : Java thread
What is difference between jdk,jre and jvm?
What are class members by default?
What is boolean false?
What is difference between classpath and path variables in java?
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)
Explain about oops concepts.
What advantage do java's layout managers provide over traditional windowing systems?
What type of language is java?
What is the use of default method in interface in java? Explain
What is the meaning of course?
What is jvm? Why is java called the platform independent programming language?
How to split arraylist elements in java?