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 are facelets templates?
What is the default value of local and global variables?
What is the platform?
How do you reverse a string in java?
Why does java have different data types for integers and floating-point values?
What are methods of a class?
What is initial size of arraylist in java?
What’s meant by anonymous class?
Name container classes in java programming?
Which is easier .net or java?
Why we cannot override static method?
What are "class access modifiers" in Java?
What is constructor chaining and how is it achieved in java?
What is the difference between normal report & matrix report?
explain copyonwritearraylist and when do we use copyonwritearraylist?