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 / vikneswarank
String s="java";
s.repalce('j','k');
System.out.println(s);
output is: java
because String is immutable.we cannt change of string
content.suppose u have to write
s=s.repalce('j','k');
output is :kava
Is This Answer Correct ? | 24 Yes | 3 No |
Post New Answer View All Answers
Which is faster call by value or call by reference?
What do you mean by JVM?
What do you understand by overloading and overriding in java?
What is annotation in java?
Is finalize() similar to a destructor?
Is hashset ordered java?
How do you execute a thread in java?
What is null mean in java?
What is qualitative variable?
What is t type java?
What is a methodologist?
What is the do while loop syntax?
What is the difference between jvm and jre? What is an interface?
What are the different approaches to implement a function to generate a random number?
Explain the usage of this with constructors?