This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes String declaration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "String declaration" Watch "String declaration" New topic
Author

String declaration

sriramaraju vysyaraju
Greenhorn

Joined: Sep 09, 2008
Posts: 8
String str="sri"+"rama"+"raju";
How many String objects are created in the above statement?
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

What's your guessed ? What you think ? If you don't have knowledge about String constant pool , Googled It !


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37945
    
  22
Originally posted by sriramaraju vysyaraju:
String str="sri"+"rama"+"raju";
How many String objects are created in the above statement?
97. And you might find something about the constant pools on the BCEL website; look at �2 and �3.
 
wood burning stoves
 
subject: String declaration
 
Similar Threads
Tech Word Game
date format with MS Access database
ResultSet to Array
WA #1.....word association
How to convert byte array into string array?