File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Length of String literal Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Length of String literal " Watch "Length of String literal " New topic
Author

Length of String literal

Bharat Makwana
Ranch Hand

Joined: May 21, 2007
Posts: 107
Hi,

Please can anybody clear my double...

I want to know,what is the length of String literal ? I think String literal are String Object so it does not have any length limitation, am I right ?


ॐ सर्वे जना: सुखिनो भवन्तु , तथास्तु |
'May the whole world be happy, so be it'

SCJP1.5, SCWCD1.5
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36478
    
  16
If you look in the Java Virtual Machine Specification, find section 4.10 about limitations, and that tells you that there are actually limits on how large a String literal can be. It is quite a lot longer than "Bhoom Bhole", you will be pleased to hear!

As for lengths of Strings, go through the API specifications, and find "String" on the lower left, and find its methods. It should be easy enough from that to work out how to get its length.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Length of String literal
 
Similar Threads
length of integers
length field on array ...
how compiler determines that String literal's length ??
what is the length limit of String literal?
Default String Constructor