Computer Science, asked by manu2607, 5 months ago

Remove duplicate characters in a string present in a sentence using Java?​

Answers

Answered by Anonymous
0

Answer:

Java program to delete duplicate characters from a given String

Convert it into a character array.

Try to insert elements of the above-created array into a hash set using add method.

If the addition is successful this method returns true.

Since Set doesn't allow duplicate elements this method returns 0 when you try to insert duplicate elements.

Print those elements.

Answered by umemaamilyawala
1

Answer:

Java program to delete duplicate characters from a given String

Convert it into a character array.

Try to insert elements of the above-created array into a hash set using add method.

If the addition is successful this method returns true.

Since Set doesn't allow duplicate elements this method returns 0 when you try to insert duplicate elements.

Print those elements.

Explanation:

i hope it's helpful

Similar questions