Solved

Error:"constant string too long",

Posted on 2004-04-05
3
3,081 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
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…

792 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