2

i'm using a variable:-

String[] string;

how to append it?

2
  • Assumedly he wants to append a String to the end of the array? Commented Sep 16, 2010 at 10:10
  • yes thats what i was thinking..... Commented Sep 17, 2010 at 12:07

1 Answer 1

7

A string array is not dynamic. It has the size you set it should have when you initialize it. To have a dynamic list of strings use ArrayList<String> instead.

To append to a normal string, take a look at StringBuilder

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.