- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
The Optimum Method to Concatenate Strings in Java.
The Optimum Method to Concatenate Strings in Java is the concat() method.
This method appends one String to the end of another. The method returns a String with the value of the String passed into the method, appended to the end of the String, used to invoke this method.
Example
public class Test { public static void main(String args[]) { String s = "Strings are immutable"; s = s.concat(" all the time"); System.out.println(s); } }
Output
Strings are immutable all the time
- Related Articles
- Concatenate Multiple Strings in Java.
- Different ways to concatenate Strings in Java
- How to concatenate two strings using Java?
- How to concatenate strings in R?
- Concatenate strings in Arduino
- In how many ways we can concatenate Strings in Java?
- How to concatenate several strings in JavaScript?
- How to concatenate two strings in C#?
- How to concatenate two strings in Python?
- How to concatenate two strings in Golang?
- How to correctly concatenate strings in Kotlin?
- Concatenate 2 strings in ABAP without using CONCATENATE function
- Python – Concatenate Strings in the Given Order
- C++ Program to Concatenate Two Strings
- C++ program to concatenate strings in reverse order

Advertisements