aspose file tools*
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
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: 39828
    
  28
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.
 
Consider Paul's rocket mass heater.
 
subject: String declaration