河南成教 / JAVA面向对象设计
[简答题]
以下程序的输出结果为_________________。。 publiccclasssTomm{{{privateefloattweight;;;privateestaticcStringgname;; publiccvoiddsetWeight(floattweight){{{{this.weightt==weight;;;}} privateevoiddout(){{ System.out.println(namee "体重:"" weightt "斤");;;}} publiccstaticcvoiddmain(String[]]args){{{{Tom.namee=="汤姆猫";;;;Tommcatt==newwTom();;;;cat.setWeight(20);;;;cat.out();;;}}
[简答题]
以下程序的输出结果为_________________。。 publiccclasssTomm{{{privateefloattweight;;;privateestaticcStringgname;; publiccvoiddsetWeight(floattweight){{{{this.weightt==weight;;;}} privateevoiddout(){{ System.out.println(namee "体重:"" weightt "斤");;;}} publiccstaticcvoiddmain(String[]]args){{{{Tom.namee=="汤姆猫";;;;Tommcatt==newwTom();;;;cat.setWeight(20);;;;cat.out();;;}}
参考答案:
佳题速递: