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
Why wait and notify methods are declared in object class?
What is the purpose of the system class in java?
Addition to previous section relative word 5th one was Putrid ans: rotten, also there was prob. in 1st section on bucket weight ans:10kg, also there was a prob. on train speed to find bridge length ans:800 mtrs.
Can a constructor be made final?
Similarity and difference between static block and static method ?
Can substring create new object?
What is oops in java?
Explain with example the concept of constant variable in java.
What is the difference between heap and stack memory?
Explain the difference between abstract classes and interfaces in java?
What does singleton class mean?
Is null a string in java?
What is the transient keyword?
What is the difference between Grid and Gridbaglayout?
How do you generate random numbers in java?