Ben Coppin wrote:
> Wow! That was pretty comprehensive. Just one thing I'm not sure about
> though:
>
> You say that
>
> out.print( "The value of variableX is " );
> out.print( variableX );
> out.println( "<BR>" );
>
> involves 0 object creations... surely just doing out.print ("some string")
> has to instantiate an object? Otherwise what gets passed to the function? I
> didn't think that strings could just exist outside of an object, or am I
> missing something there?
>
> Cheers,
>
> Ben
>
If you read Paul's statement as "0 object creations at runtime" it makes much
more sense. Essentially, string constant "objects" are created at compile
time, and are preloaded with the byte codes when you first load the class. The
other assumption is that variableX already exists because you needed it for
something, so the act of calling out.print doesn't create a new one.
Craig
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html