0

Okay, then it was intentional. Then the execution is correct. But I'm not sure that your design is quite there.

Swapping the first and last elements won't make them random, it'll just make them different. What is it you're trying to do with this swap? How does it fit into your larger goal of returning a random permutation of the characters in a string?

0

Okay, then it was intentional. Then the execution is correct. But I'm not sure that your design is quite there.

Swapping the first and last elements won't make them random, it'll just make them different. What is it you're trying to do with this swap? How does it fit into your larger goal of returning a random permutation of the characters in a string?

hello sir,


the last element sir which is ran.nexInt(name.length()-1) is assign to integer n,
ran is instantiate of Random ran = new Random();that's why it will random the last element and swap to the first element...that's what i got sir..but if you have some suggestion to my code to make it better i will greatly appreciate,please share your idea sir..hoping for your positive responds...thank you in advance...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.