เขียนโปรแกรม

ขอสอบถามหน่อยครับ
ภาษา java ครับ
ทำไม ส่วนที่ return String.format คำว่าformat มันerror ครับ
นี่ codeครับ ตรงบรรทัดสุดท้ายครับ
import com.sun.javafx.binding.StringFormatter;
import com.sun.org.apache.xpath.internal.operations.String;

public class boxv2 {
    private double w,h,d;

    public boxv2(double w,double h,double d){
        setW(w);
        this.h = h;
        this.d = d;
    }
    public boxv2(){

    }

    public double getW(){
        return w;
    }

    public void setW(double w)
    {
        if (w > 0.0) {
            this.w = w;
        }else
            {
                throw new IllegalArgumentException("ค่าความกว้างจะต้องมากกว่าศูนย์");
            }
    }
    public void setH(double h)
    {
     this.h = h;
    }
    public void setD(double d)
    {
        this.d = d;
    }

    public double vol()
    {
        return w*h*d;
    }
    public double sur(){
        return (2.0*w*h)+(2.0*w*d)+(2.0*d*h);
    }

    @Override
    public String toString(){
        return String.format
    }



}
แก้ไขข้อความเมื่อ
คำตอบที่ได้รับเลือกจากเจ้าของกระทู้
ความคิดเห็นที่ 5
// import com.sun.javafx.binding.StringFormatter;
// import com.sun.org.apache.xpath.internal.operations.String;

java.lang.String

อะไร ๆ ใน java.lang.*
เราใช้ได้เลย  ไม่ต้อง import นะครับ
แสดงความคิดเห็น
โปรดศึกษาและยอมรับนโยบายข้อมูลส่วนบุคคลก่อนเริ่มใช้งาน อ่านเพิ่มเติมได้ที่นี่