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 / pradeep rout

public class Test {

public static void main(String args[])
{

String s="java";
System.out.println("Before>>>>>>>"+s);
s=s.replaceAll("j", "k");
System.out.println("After>>>>>>>"+s);


}
}
----------------------Output---------
Before>>>>>>>java
After>>>>>>>kava

Is This Answer Correct ?    11 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you explain the usages of class.forname()?

1013


What is map and hashmap in java?

1025


What state does a thread enter when it terminates its processing in java programming?

976


How to restrict a member of a class from inheriting by its sub classes?

1282


How we can execute any code even before main method?

1074


What is linked hashmap and its features?

970


What is multithreading and its advantages?

1014


What is data object example?

935


Difference between object instantiation and construction ?

1007


Why is it called buffering?

1051


What is difference between final and immutable?

1071


How many bits are in a sentence?

1069


how to prepare for IT Officers Interview in Banks

1911


Explain why wait(), notify() and notifyall() methods are in object class rather than in thread class?

945


Can we create an object if a class doesn't have any constructor ( not even the default provided by constructor ) ?

1021