Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJP
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Liutauras Vilda
Paul Clapham
Sheriffs:
paul wheaton
Tim Cooke
Henry Wong
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Piet Souris
Bartenders:
Mike London
Forum:
Programmer Certification (OCPJP)
Regarding Strings
prarthana reddy
Ranch Hand
Posts: 48
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
Please have a look at the following question:
How many
String
objects are created when we run the following code.
String s1,s2,s3,s4;
s1 = "Hello";
s2 = s1;
s3 = s2 + "Pal";
s4 = s3;
can anyone please give me the answer ?
Naina Si
Ranch Hand
Posts: 134
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
two objects
Naseem Khan
Ranch Hand
Posts: 809
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Three objects created here.
"Hello" and "Pal" is created at class load time as they are compile time constants, "HelloPal" at the time of the execution of the class.
Naseem
Asking Smart Questions FAQ
-
How To Put Your Code In Code Tags
cathymala louis
Ranch Hand
Posts: 77
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Three objects created.
1. Hello
2. pal
3. Hello pal
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
?
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
question...
please help me
== with Strings is giving a different result
From Velmurugan's Mock Exam
String Objects
More...