Error:"constant string too long",

Hi all,

I'm trying to process a String that is approx 200,000 characters long. I know this is a huge 'string' but it is actually a representation of a document.

When I try to process this in JAVA I get the error

"java:6: constant string too long".

Is there an 'object' class along the lines of 'int' which is extended to 'long' for the string class?

Any help is much appreciated.
Who is Participating?
Tommy BraasConnect With a Mentor Commented:
You should be able to use the StringBuffer class.
Tommy BraasConnect With a Mentor Commented:
The maximum length of a String in Java is 64kb (65535 characters).
>>(65535 characters).

Wouldn't that be 128kb? That seems a strange size. Where is this defined o?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.