java - Printing a method -


i need call method returns code below. using in enhanced loop objects in array. however, when try print out, error.

public string tostring(){     return string.format("length:%d\nwidth:%d\nheight:%d\n", length,width,height); 

this used main.

for(box n:boxes) system.out.printf(n.tostring()); 

the error is

exception in thread "main" java.util.illegalformatconversionexception: d != java.lang.double  


Comments

Popular posts from this blog

javascript - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

java - Reading data from multiple zip files and combining them to one -