struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Whittaker" <mike_whitta...@ntlworld.com>
Subject RE: [OT] Java Trivia
Date Thu, 12 Jun 2003 14:12:54 GMT

>Anybody know why the length of a String is a property of the String when
>used as a logical qualifier in a for{} block but a function of the 
>String in
>a conditional if{} statement?
>
>for( int i = 0; i < string.length; i++ ) {}
>
>if( string.length() != 4 ) {}
>
>
>Mark

for( int i = 0; i < string.length; i++ ) {}

You can't do this.

Even though a string is just a char[].

--
Mike W




---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message