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
Explain the difference between an Interface and an Abstract class?
What is hashtable and explain features of hashtable?
What is the difference between replace and replace all?
Can a source file contain more than one class declaration?
Is string thread safe in java?
What is threaded programming and when is it used? : Java thread
What are strings in physics?
Can final class have constructor?
What is a functional interface?
How can we use primitive data types as objects?
What is better - 'bit-shift a value' or 'multiply by 2'?
What do you mean by compiler?
How define set in java?
Explain about the select method with an example?
Is map ordered in java?