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
What is a top level class in java?
How will you print number in reverse (descending) order in BST.
How is treeset implemented in java?
Can we convert integer to string in java?
What’s the difference between unit, integration and functional testing?
What is the full meaning of java?
What restrictions are placed on method overriding?
Why does java doesnt suuport unsigned values?
What is callable java?
Why java is used everywhere?
Difference between current previous versions of Java?
Which class should you use to obtain design information about an object in java programming?
Is Java a dying language?
When does a class need a virtual destructor?
What is the use of optional ?