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
What is a java applet? What is an interface?
What is a class variable?
What is constructor and its types?
Is main a function?
Is java type safe?
What is byte data type?
How many types of methods are there?
What is the difference between a scrollbar and a scrollpane?
What do you mean by scope of variable?
What is replacefirst in java?
what is aggregation in java?
Make a data structure and implement an algorithm to print all the files in a directory. (The root directory can have sub-directories too.)
Give some features of interface?
How does java pattern compile work?
You're given a Boolean 2D matrix, can you find the number of islands?