基本信息
文件名称:《Java语言程序设计》答案.docx
文件大小:89.94 KB
总页数:15 页
更新时间:2025-10-26
总字数:约2.19万字
文档摘要
PAGE
PAGE1
《Java语言程序设计》答案
第一套题
一、简答题
1什么是多态性?方法的重载和覆盖有何区别?阅读下列代码,指出其中存在的重载和覆盖,写出输出结果是什么?解释为什么这样输出?(15分)
classC1
{
publicvoidf(){
System.out.println(C1.f);
}
}
classC2extendsC1
{
publicvoidf(){
System.out.println(C2.f);
}
}
classC3{
publicvoidg(C1one){
Syste