Change value of a string array at debug eclipse--

Source: Internet
Author: User

Question:

I have an application, but to test something, I need to the change value of a String[] .

But if I do it using the change value in variables tab, everytime it gives error.

I have tried using:

{"string1", "string2"}

["string1", "string2"]

[string1, string2]

etc. But had no luck. Can anybody plese tell how to does this?

Answer:

See, you can ' t actually the Add (change) value in the array while debugging.

But there was a work around, you need to assign new string array to this reference like,

new String[]{"string1", "string2"}

But this would remove old entries, so if you want to only add new values best-of-the-the-to, copy-old values from the varia Bles tab.

new String[]{old values..., "string1", "string2"}

Original address: Http://stackoverflow.com/questions/23270464/change-value-of-string-array-at-debug-eclipse

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.