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
Post a Comment