my dog learned polymorphism
The moose likes Beginning Java and the fly likes String declaration Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply 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: 2896
    
    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: 32692
    
    4
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 agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: String declaration
 
Similar Threads
How to convert byte array into string array?
date format with MS Access database
Tech Word Game
WA #1.....word association
ResultSet to Array