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

How to connect to a remote database using Applet?

2292


Describe string intern() methodology

843


Explain the difference between string, stringbuffer and stringbuilder in java?

799


What is maximum size of arraylist in java?

739


Why are the methods of the math class static?

843


what is predefined function in java?

779


What is a pattern what is an anti pattern?

731


What is a pointer and does java support pointers?

811


What is Java Package and which package is imported by default?

859


What is the purpose of a parameter?

815


What is the difference between static and non-static variables in java programming?

740


What is toarray method in java?

810


Explain different types of thread priorities ?

889


What happens if an exception is not handled in a program?

883


Where is jre installed?

831