Skip to content
Advertisement

I want to swap characters of string in java but it returns garbage value can you please tell me what is wrong with my code

I want to swap characters of string but this program returns garbage value. Can you please tell me what is wrong with my code.

JavaScript

Advertisement

Answer

You have to use constructor of String class. Then it will work fine.

JavaScript
Advertisement