File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How we can type cast TreeSet into String array

 
kalai sundar
Ranch Hand
Posts: 69
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my code

java.util.TreeSet tm = new java.util.TreeSet(java.util.Arrays.asList(row));

this tm returns treeset right
i want this tm object to be copied to String[] array how i can do it

How i can do it , anyone hepl me


kalai
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This isn't casting but it works:

String[] array = (String[])set.toArray( new String[0] );
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic