3:40 am - Saturday August 19, 2017

Concatenate two string String concat(String str)

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044

                                      Concatenation method is used for joining two string.

Example Program

public class Model1 {

public static void main(String args[])

 {

              String k = "happy ";

              k = k.concat("diwali");

              System.out.println("wish u"+" "+(k));

  }

  }

Output

           wish u happy diwali

Description:

                       In this program string variable (k) is concatenated to another variable (k= k.concat()) .

Filed in: Java Examples

Comments are closed.