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
Tell us something about set interface.
Why do we need autoboxing in java?
What is boolean logic?
What is volatile data type?
Can we convert stringbuilder to string in java?
What is identifier give example?
What is hotjava?
What are the advantages of defining packages in java?
What are triggers in DB? Explain their types. How do they work?
How many bytes is a string?
why java uses class level type casting ?
Differece between class and generic class?
Can I learn java in 3 months?
How do you add an arraylist to an array in java?
How many types of variables are there?