This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Question on the String max size 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 » Beginning Java
Bookmark "Question on the String max size" Watch "Question on the String max size" New topic

Question on the String max size

A Chavda

Joined: Apr 15, 2008
Posts: 3
could any one tell me what is the maximum size for the string . To my opinion its 2^16 that is 65536 bytes. Also string is the sequence of char array. So i need to know 65536 bytes means string value can be of 65536 characters.

Take an example I have a string variable and says that it should be of 255 max size. should i consider this as 255 characters value.

Please clear my doubts

Thanks in advance
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Please check your private messages regarding an important administrative matter.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 11152

Also, we have this neat "search" feature at the top of (almost?) every page. I search this forum for "String max size", and in about 2 seconds, found this thread.

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Question on the String max size
Similar Threads
data access
max length of doGet() request supported by browser
Max number of characters printed in system.out.println
Deciphering the instructions