File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes How many string object created in this code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "How many string object created in this code" Watch "How many string object created in this code" New topic
Author

How many string object created in this code

Madhawi Maurya
Ranch Hand

Joined: Aug 22, 2007
Posts: 42
hi friend,

How many String objects will be created when this method is invoked?
Answer is given 3.
But it should be 5. that is
"fred"
"47"
"fred47"
"ed4" and
"ED4"

please clear me.


SCJP1.5 with 90%
Ravikanth kolli
Ranch Hand

Joined: Feb 10, 2008
Posts: 179

hi
This is a repitition of the question that is postedhere


-kolli
Madhawi Maurya
Ranch Hand

Joined: Aug 22, 2007
Posts: 42
thanks kolli
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How many string object created in this code