View Single Post
Old Jun 29th, 2012, 10:08 AM   #11
PaCkEtPiRaTe
Software Developer
 
PaCkEtPiRaTe's Avatar
 
Join Date: Aug 2007
Location: Massachusetts, USA
Posts: 696
Rep Power: 11 PaCkEtPiRaTe will become famous soon enough
Send a message via AIM to PaCkEtPiRaTe Send a message via Skype™ to PaCkEtPiRaTe
Re: Problem Reading a File

Quote:
Originally Posted by macteki View Post
It worked because showInputDialog() is expecting String array instead of Object array. If you passed an object array into it, the default "toString()" method would be called, which is implementation dependent.



There are two method declaration for toArray() in java.util.Set

1. Object[] toArray()
Returns an array containing all of the elements in this set.

2. <T> T[] toArray(T[] a)
Returns an array containing all of the elements in this set; the runtime type of the returned array is that of the specified array.

See this link for reference.

http://docs.oracle.com/javase/6/docs.../util/Set.html
I guess I must have missed that in the list of methods in Netbeans. Any idea on what's causing the other problem?
__________________
I'm trying to change the world, but I can't find the source code...
PaCkEtPiRaTe is offline   Reply With Quote