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 covariant method overriding in java.
What is the difference between arraylist and hashset in java?
Why does java have different data types for integers and floating-point values?
Describe 2 different ways to concatenate two strings.
What is anti pattern in programming?
What is a final class in java?
What are the different types of multitasking?
How many types of design patterns are there?
What is the full form of jpeg?
What is a java object and java application?
Can you extend main method in java?
Differences between C and Java?
How java enabled high performance?
What is type inference in java8?
Define how destructors are defined in java?