Alex Rivera | Logout

Append a single character to a string or char array in java?

Asked 2013-01-21T18:10:58.200
67

Is it possible to append a single character to the end of array or string in java. Example:

private static void /*methodName*/ () {            
    String character = "a"
    String otherString = "helen";
    //this is where i need help, i would like to make the otherString become 
    // helena, is there a way to do this?               
}
Edit
Report

1 Answer

2

just add them like this :

        String character = "a";
        String otherString = "helen";
        otherString=otherString+character;
        System.out.println(otherString);
answered 2013-01-21T18:13:53.700

Your Answer