The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes String Objects.... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "String Objects...." Watch "String Objects...." New topic
Author

String Objects....

Alok Sinha
Greenhorn

Joined: Nov 23, 2000
Posts: 4
I got this question in one of the mock tests.It asks to count the no. of String objects created.
The given answer is 3 but I think it should be 2.
the question goes like thos:

String s1,s2,s3,s4;
s1="hello";
s2=s1;
s3=s2+"pal";
s1=s3;

[This message has been edited by Alok Sinha (edited November 26, 2000).]
zulfiqar raza
Ranch Hand

Joined: Oct 18, 2000
Posts: 81
Three string objects:
"hello"
"pal"
"hellopal"
"pal" would be an anonymous string object.
zulfiqar
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: String Objects....