Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Error:"constant string too long",

Posted on 2004-04-05
3
Medium Priority
?
3,994 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 400 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 400 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

Independent Software Vendors: 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

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…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

886 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