Solved

Error:"constant string too long",

Posted on 2004-04-05
3
3,205 Views
Last Modified: 2007-12-19
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.
0
Comment
Question by:highlyevolved
  • 2
3 Comments
 
LVL 14

Assisted Solution

by:Tommy Braas
Tommy Braas earned 200 total points
ID: 10761088
The maximum length of a String in Java is 64kb (65535 characters).
0
 
LVL 14

Accepted Solution

by:
Tommy Braas earned 200 total points
ID: 10761092
You should be able to use the StringBuffer class.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10762020
>>(65535 characters).

Wouldn't that be 128kb? That seems a strange size. Where is this defined o?
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
spring jars download 1 53
Detect Closed Loops (circles, figure-8s, etc) in PNG Images 6 77
Java: anonymous class 4 38
dao vs facade design patterns 2 38
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question