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
Can we catch more than one exception in a single catch block?
How do we access static members in java?
What is style and indentation?
What happens when heap memory is full?
How many ways can we create the string object?
What is the difference between Java1.4 and Java1.5
Objects or references which of them gets garbage collected?
What is meant by polymorphism?
Can you explain the cs option of java interpreter?
Can you instantiate the math class in Java?
What is an empty class? What functionality does it offer in Java?
What is a native method in java programming?
Explain about the main() method in java?
What is the difference between multiple processes and multiple threads?
What is printwriter in java?