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 / nikhil hegde

when u say s.replaceAll('j','k') their will be no output but
internally the string s will be stored as kava. so when u
ask for the output the output will be kava

Is This Answer Correct ?    3 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does list maintain insertion order java?

707


Explain the importance of import keyword in java?

782


Can memory leak happen java?

795


Write a java program for binary search?

808


When should we create our own custom exception classes?

803


When can you say a graph to be a tree?

854


What are different access specifiers in java? Explain

848


What is module in oop?

783


What are desktop procedures?

808


If we don’t want some of the fields not to serialize how to do that?

801


Can java cast null?

792


What is the difference between final, finally and finalize() in java?

803


What is an association?

768


Is java a digit method?

759


What is singleton service?

722