aabccdee
Find the used alphabets as abcde ?

Answer Posted / deepu

package com.thread;
import java.util.*;
public class Test2 {





public static void main(String[] args) {
String str="aabbbcdabbheaa";
char[]chs=str.toCharArray();
List l1=new ArrayList();

for(Character ch:chs){
l1.add(ch);
 
}
Set s1=new TreeSet(l1);
System.out.println(s1);
}




}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Tell us something about set interface.

561


Why do we need autoboxing in java?

516


What is boolean logic?

559


What is volatile data type?

549


Can we convert stringbuilder to string in java?

557






What is identifier give example?

551


What is hotjava?

554


What are the advantages of defining packages in java?

504


What are triggers in DB? Explain their types. How do they work?

623


How many bytes is a string?

558


why java uses class level type casting ?

2253


Differece between class and generic class?

564


Can I learn java in 3 months?

539


How do you add an arraylist to an array in java?

507


How many types of variables are there?

668