View RSS Feed

Java String

All about Java String.

  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:
    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 ...