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
What are different types of states exist for a thread?
What is difference between ++ I and I ++ in java?
Difference between object instantiation and construction ?
what is meant by encapsulation?
Is a class subclass of itself?
What is the disadvantage of synchronization?
Where and how can you use a private constructor?
How do you escape in java?
can any body body expalin best definitions & best real time exaples for opps concepts.
What is io stream in java?
Explain thread in java?
What is your platform?s default character encoding and how to know this?
What is the meaning of I ++ in java?
Is intellij better than eclipse?
What is the core java?