首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
接口是抽象方法和常量的集合,是一种特殊的抽象类。下面的程序是对接口的操作,请在程序的每条横线处填写一个语句,使程序的功能完整。 注意:请勿改动main()主方法和其他已有的语句内容,仅在横线处填入适当的语句。 _____________
接口是抽象方法和常量的集合,是一种特殊的抽象类。下面的程序是对接口的操作,请在程序的每条横线处填写一个语句,使程序的功能完整。 注意:请勿改动main()主方法和其他已有的语句内容,仅在横线处填入适当的语句。 _____________
admin
2009-01-15
39
问题
接口是抽象方法和常量的集合,是一种特殊的抽象类。下面的程序是对接口的操作,请在程序的每条横线处填写一个语句,使程序的功能完整。
注意:请勿改动main()主方法和其他已有的语句内容,仅在横线处填入适当的语句。
______________MyInterface
{
public static int NUM=100;
public abstract void print();
}
public class ClassName___________MyInterface
{
public void print()
{
System.out.println(NUM);
}
public static void main(String args[])
{
__________________________
obj .print();
}
}
选项
答案
interface implements ClassName obj=new ClassName();
解析
本题主要考查接口、如何生成一个类的对象知识。解答本题的关键是熟练掌握接口、如何生成一个类的对象知识。在本题中,interface MyInterface语句中的interface的功能是声明接口MyInterface,public class ClassName implements MyInterface语句中的implements的功能是声明ClassName并实现MyInterface接口,ClassName obj=new ClassName();语句的功能是生成 ClassName型的对象obj。
转载请注明原文地址:https://jikaoti.com/ti/7xb0FFFM
本试题收录于:
二级Java题库NCRE全国计算机二级分类
0
二级Java
NCRE全国计算机二级
相关试题推荐
下面属于表单方法名(非事件名)的是
1.在考生文件夹下建立数据库BOOKAUTH.DBC,把表BOOKS和AUTHORS添加到该数据库中。2.为AUTHORS表建立主索引,索引名为“PK”,索引表达式为“作者编号”。3.为BOOKS表建立两个普通索引,第一个索引名为“PK”,索引
在考生文件夹下,打开“宾馆”数据库,完成如下简单应用:1.使用查询设计器设计一个名为TWO的查询文件,查询房价价格大于等于280元的每个客房的客房号、类型号(取自客房表)、类型名和价格。查询结果按类型号升序排列,并将查询结果输出到表TABB中。设
1.在考生文件夹下新建一个名为“学校”的数据库文件,并将自由表“教师表”、“课程表”和“学院表”依次添加到该数据库中。2.使用SQL语句ALTERTABLE…UNIQUE…将“课程表”中的“课程号”定义为候选索引,索引名是temp,并将该语句存储到
在VisualFoxPro中,可以链接或嵌入OLE对象的字段类型是();
下列特征中不是面向对象方法的主要特征的是()。
下面属于黑盒测试方法的是
用DIMENSION命令定义数组后,数组各元素的值是
算法的有穷性是指
所有的输出过滤流都是抽象类______的子类。
随机试题
通过阻碍横桥和肌动蛋白结合,调节肌肉收缩过程的蛋白质是
在刚性基础设计时,通常要使基础大放脚与基础材料的刚性角一致,其目的是()。
在综合布线系统中,从建筑群配线架到各航站楼的布线属于()子系统。
下列行为中不符合承揽合同特征的是()。
负债比率越高,则权益乘数越低,财务风险越大。()
(2004年卷四第54题)以下关于实用性概念的哪些说法是错误的?
为什么说世界上完整的佛教和完整的佛教经典都在中国?
“坐地日行八万里,巡天遥看一千河”,这一诗句包含的哲理是:
区分度的计算方法有
A.additionalB.ideallyC.alteredD.personalE.likelyF.excessiveG.virtually
最新回复
(
0
)