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
Is it possible to write a regular expression to check if string is a number?
Java openings 3 - 5 years, Lnt Infotech. requirements - core java, J2ee, struts, hibernate Interview Date:- 19 March 2011 Time:- 9:00 AM to 12:00 Pm Interview Location - L & T Infotech, Manapakkam, Chennai Refererral PS NO:- 291649 (Please mention this when u fill the form only then u will be considered for interview) Documents Required:- Latest Resume, Photograph and last 3 payslips Mail me on vasan2211@gmail.com once u appear for interview
Are private methods final?
please send me hr interview questions in it industry
What are the advantages of passing this into a method instead of the current class object itself?
What is the public method modifier?
How can I become a good programmer?
Can we override data members in java?
What is a boolean output?
What is difference between synchronize and concurrent collection in java?
According to java operator precedence, which operator is considered to be with highest precedence?
What is the nested interface?
Can a class extend 2 classes in java?
What is vector?
23. Storage space in java is of the form Stack Queue Heap List 24. What is java code embedded in a web page known as Applets Servlets scriptlets snippets 25. Which of the following attributes are compulsory with an