aspose file tools*
The moose likes Beginning Java and the fly likes double array to String Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "double array to String" Watch "double array to String" New topic
Author

double array to String

zoyu mi
Greenhorn

Joined: Mar 29, 2013
Posts: 3
I need to use the toString() method but I dont how to chance an array of double primitive type into a string of only the values of the array.
Help please. Very confused
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

Arrays don't override the toString() method. So if you want to print the contents of an array, you have to iterate over the array and add each element to a StringBuilder (or just print them as you go). Or you can use java.util.Arrays.toString() for 1D arrays and Arrays.deepToString() for multi-dimensional arrays (which are really just arrays of arrays in Java).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: double array to String
 
Similar Threads
I'm lost, need help figuring what todo?
Casting issue
Array class?
Find min and max in ArrayList
JSTL : Retrieve Param Values Using Loop