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
Does java allow overriding static methods ?
What is the difference between JDBC 1.0 and JDBC 2.0?
What the difference is between execute, execute Query, execute Update?
Write a java program to print fibonacci series?
What are filterstreams?
Can subclass overriding method declare an exception if parent class method doesn't throw an exception?
What is the static variable?
How do I convert a string to an int in java?
What is the purpose of the finalize() method?
Explain the JDB in depth & command line.
What is the difference between static method and instance method in Java?
What is the use of string and stringbuffer?
what is object slice?
What’s the difference between the methods sleep() and wait()?
I am a fresher and know core java, c languge, html, css etc if I am illegible for any job then send it on my email tatranakshay276@gmail.com