View RSS Feed

Recent Blogs Posts

  1. Concatenating Strings

    by , 04-26-2012 at 07:27 PM
    A method is present in String class for concatenation of 2 strings:
    Java Code:
    string1.concat(string2);
    New string will be returned, that is, string1 and string2 will be added in the end. Concat() method could also be used along with string literals:
    Java Code:
    "My name is ".concat("Zara");
    Commonly, strings are concatenated along with +operator:
    Java Code:
    "Hello," + " world" + "!"
    Result ...
    Categories
    String