求JAVA高手帮我做一下这两道复习题,我好对答案

求JAVA高手帮我做一下这两道复习题,我好对答案
四、程序查错
class Example_1 {
public static void main(String[] args){
byte x=127;
float f=12.58;
System.out.println("x="+x+",f="+f);
}
}

五、程序填空
_______ class human {
public _____ void walk();
}
class man ______ human{
void walk(){System.out.println("Man is walkng!");}
}
q56dasgz 1年前 已收到1个回答 举报

serendipity 幼苗

共回答了24个问题采纳率:87.5% 举报

第一题,运行错误.
应该是:float f = 12.58f;
第二题
abstract class human {
public abstract void walk();
}
class man extends human {
void walk() {
System.out.println("Man is walking!");
}
}

1年前

7
可能相似的问题
Copyright © 2024 YULUCN.COM - 雨露学习互助 - 16 q. 0.022 s. - webmaster@yulucn.com