Meaningless Drivel is fun!*
The moose likes Java in General and the fly likes maximum characters in string Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "maximum characters in string" Watch "maximum characters in string" New topic
Author

maximum characters in string

Kowshik Nandagudi
Ranch Hand

Joined: Dec 09, 2010
Posts: 57
what is the maximum number of characters that can be stored in string???
Tom Reilly
Rancher

Joined: Jun 01, 2010
Posts: 618
Integer.MAX_VALUE or, theoretically, half your heap size - whichever is smaller.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

This is not the first time someone asks this question on the forums here. I wonder why this is such an interesting question.

Is this an interview question that gets asked to a lot of people? If it is, then the goal is probably not to check if you know the answer, but to find out how you reason to find an answer to the question.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Jesper de Jong wrote:This is not the first time someone asks this question on the forums here. I wonder why this is such an interesting question.

This might be asked at Jeopardy.


[My Blog]
All roads lead to JavaRanch
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37884
    
  22
Christophe Verré wrote: . . . This might be asked at Jeopardy.
Does that mean this thread should move to "MD"?
 
Consider Paul's rocket mass heater.
 
subject: maximum characters in string
 
Similar Threads
Breaking up text in lines
Max length for a String?
max size of a string
is there a maximum length for java.lang.String?
How to put clob in org.w3c.dom.Document