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
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Programmer Certification (OCPJP)
Strings Replace()
Deepa aroon
Greenhorn
Posts: 14
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Strings are immutable.
String
objects once created cannot be modified.So, Can we use String replace(char old,char new) on string objects?
Vijay Tidake
Ranch Hand
Posts: 148
I like...
posted 12 years ago
1
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
As you said Strings are immutable.so if you you call a replace() on a String object a new string will be created each time
Thanks
The important thing is not to stop questioning.Curiosity has its own reason for existing.
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
I like...
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
you can call a update method on immutable object(say rr), but it wont affect the existing object rr, instead that method will create a new object(say ss) and return ss.
Deepa aroon
Greenhorn
Posts: 14
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
yes i got it!!! thanks ranchers :-)
Something must be done about this. Let's start by reading this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Replace
Removing or replacing a enter key chararcter from a string??
How many Objects are garbage collected?
replace method
How many Objects are garbage collected?
More...