Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Can we catch more than one exception in a single catch block?

1018


How do we access static members in java?

1058


What is style and indentation?

953


What happens when heap memory is full?

923


How many ways can we create the string object?

960


What is the difference between Java1.4 and Java1.5

2252


Objects or references which of them gets garbage collected?

915


What is meant by polymorphism?

957


Can you explain the cs option of java interpreter?

896


Can you instantiate the math class in Java?

1024


What is an empty class? What functionality does it offer in Java?

1202


What is a native method in java programming?

1001


Explain about the main() method in java?

1019


What is the difference between multiple processes and multiple threads?

1111


What is printwriter in java?

902