I have a String s = java; What is the output when I say
s.replaceAll('j', 'k'); Also what is the value of s after
replacing?
Answer Posted / puneet
No, the strings are immutable; the value of s will be the
same but new object kava will get crated which wil have no
refrence. s will refer to the same object which is not
changed.
s=s.replace("",""); should have worked...otherways
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
Explain java heap space and garbage collection?
What is size of int in java?
What is defined as false sharing in the context of multithreading?
How do you reverse a list?
What technique can be employed to compare two strings?
How do you find the maximum number from an array without comparing and sorting?
What is the main purpose of serialization in java?
How do you reverse sort a list in java?
What is constructor in java ?
What is java util function?
23. Storage space in java is of the form Stack Queue Heap List 24. What is java code embedded in a web page known as Applets Servlets scriptlets snippets 25. Which of the following attributes are compulsory with an
What is a java developer salary?
What do you mean by of string::valueof expression in java 8?
Compare overloading and overriding?
Can we convert list to set in java?