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

What are the restrictions imposed on method overriding?

1059


Why there is no call by reference in java?

973


What is a arraylist in java?

1121


Is null keyword in java?

1001


What does those terms actually mean included in the j.d.k i.6?

2173


List out five keywords related to exception handling ?

1058


Is an integer an object?

1031


What is close method? How it's different from Finalize & Dispose?

1122


Explain how can you debug the Java code?

1114


Explain the importance of throws keyword in java?

1042


When do you call copy constructor?

1023


What is a for loop in java?

1095


How do I stop concurrentmodificationexception?

1079


What is bifunction in java?

1267


What are different types of states exist for a thread?

1053