File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 11736

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
I agree. Here's the link:
subject: Question on the String max size