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
how would you implement a thread pool? : Java thread
In how many ways we can create threads in java?
how to create multithreaded program? Explain different ways of using thread? : Java thread
What is string builder in java?
How are multiple inheritances done in Java?
What is the difference between JDBC 1.0 and JDBC 2.0?
What is object data type?
When can an object reference be cast to an interface reference in java programming?
What is polymorphism and what are the types of it?
Write a program to print fibonacci series
what do you mean by marker interface in java?
How do you check if a number is a perfect square?
What do you mean by Hash Map and Hash Table?
What is super constructor?
What is the difference between procedural and object-oriented programs?