My Blog
Articles related to programming, computer science, technology and research.

14/05/2018 Categories: Strings. 2 Comments on Java program to ignore duplicates in a string and print each character only once in ascending order

This is a Java program that accepts a string from the user, ignores any duplicate characters and prints each character only once in ascending order.


We use TreeSet class from collections framework for printing the characters in ascending order.


The program is as follows:



If you want to display in insertion order, you can use LinkedHashSet.

Related Links:


You can follow any responses to this entry through the RSS 2.0 feed.

Heya i am for the first time here. I came across this board and I
find It really useful & it helped me out a lot.
I hope to give something back and aid others like you aided me.

Hurrah, that’s what I was looking for, what a stuff!
existing here at this weblog, thanks admin of this site.

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll Up