The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
January 2002

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Use length property of array to get the total words

Posted by Kishori Sharan on January 21, 2002 at 11:12 AM

Hello
Every array in java is an object and it has a propery named "length" which returns the number of elements in that array. Sor words.length will return 4 in your case. If you have more words and you want to know the total then just use words.length and it will give you the value you want.
Thanks
Kishori



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us