This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman 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 Building Microservices this week in the Design 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: 2904
    
    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: 44068
    
  33
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.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: String declaration
 
It's not a secret anymore!