permaculture playing cards*
The moose likes Java in General and the fly likes length vs length() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "length vs length()" Watch "length vs length()" New topic
Author

length vs length()

Anand Divakaran
Greenhorn

Joined: Jul 20, 2007
Posts: 6
when using string objects , when can i use str.length and str.length();
str is a object reference of type string
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24166
    
  30

You may call the "length()" method on a String, and access a "length" member variable on an array. String does not have a "length" member variable as arrays (appear to) have.


[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: length vs length()
 
Similar Threads
how to do this? (exception) can u help me to fix?
Boolean type from 0 length string
about exception
Concatenating Strings
Index of the last character of Strings