首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2SE开发 >

SCJP 题目

2012-02-13 
SCJP 题目求助QuestionGiven:11. class Mud {12.//insert code here13.System.out.println(hi)14.}15.

SCJP 题目求助
Question
Given: 
11. class Mud {
12. //insert code here
13. System.out.println("hi");
14. }
15. }

And the following five fragments:
public static void main(String...a){
public static void main(String.* a){
public static void main(String... a){
public static void main(String[]... a){
public static void main(String...[] a){

How many of the code fragments, inserted independently at line 12, compile?
A. 0
B. 1
C. 2
D. 3
E. 4
F. 5

参考答案是:三个。
请问是哪三个及理由。
(String...a)和(String... a)有区别吗?
非常感谢。

[解决办法]
1:零个或者多个String相当于String[]
3:同一
4:零个或者多个String[]
[解决办法]

探讨
引用:
String[]... a就是把main当作一个普通的方法看待,只有String[] a或String... a(类型和参数间的空格可没有)才会被当作程序启动入口。


“类型和参数间的空格可没有”
这个怎么理解?
可以没有String?或者String换成其它?
thx

热点排行