当前位置: 技术问答>java相关
SCJP的试题,请回答为什么和答案
来源: 互联网 发布时间:2015-03-03
本文导语: 1。which is true a. A method is an interface must not have a body b. a class may extend one other class plass at most one inerface; c. a class may textend at most one other class plus implement many interfaces d. an class...
1。which is true
a. A method is an interface must not have a body
b. a class may extend one other class plass at most one inerface;
c. a class may textend at most one other class plus implement many interfaces
d. an class accesses an tnterface via the keyword uses
2. what does the zeroth element of the string array passed to the public static void main method contain?
a. the name of program
b. the number of arguments
c. the first argument if one is present;
a. A method is an interface must not have a body
b. a class may extend one other class plass at most one inerface;
c. a class may textend at most one other class plus implement many interfaces
d. an class accesses an tnterface via the keyword uses
2. what does the zeroth element of the string array passed to the public static void main method contain?
a. the name of program
b. the number of arguments
c. the first argument if one is present;
|
1、c,一个类最多可以从一个其它类上派生并实现多个接口,没有显式派生的实际上也派生了,超类是Object。
2、c,和c语言不同,参数数组的第一个元素是可能的第一个命令行参数而不是程序名。
2、c,和c语言不同,参数数组的第一个元素是可能的第一个命令行参数而不是程序名。
|
1.A中错把in写成is了吧。接口方法不能有程序体,所以a是正确的。c当然也是对的,理由同 cherami(cherami)。
2.同 cherami(cherami)。
2.同 cherami(cherami)。
|
我做出上述的评论是基于题目同时出现两个错误,首先题目要求单选,答案a中又有拼写错误,所以提出以上观点,如果改为in的话,同时题目不要求单选的话,那么1的答案基本没有什么问题,有一个小小的不敢肯定的是must not的意思,是不必呢还是不能呢?